Steemer app update - Almost ready for release

in #utopian-io6 years ago

Repository

https://github.com/hispeedimagins/steem

STEEMER-BANNER02.png

steemer is a native android applications written in kotlin which is easy to use and has the unique benefit for the user where the beneficiaries feature can be disabled and the app can be used just like steemit. Totally free.

New Features

Search powered by AskSteem

Steemer needed a way for users to search the vast expanse of steem. Even better than trending or new with tags. You need phrases for an app. That is where AskSteem steps in and fills the void.

Implementing their api is very simple. You have to send GET requests.

val url = "https://api.asksteem.com/search?q=$query&include=payout,meta&types=post&pg=$page"

The $query and the $ page are the dynamic variables. The max page numbers are 10.

For searching users I used the api by steemit for getting account reputations.

"{"id":""+id+"",
"jsonrpc":"2.0",
"method":"call",
"params":["follow_api","get_account_reputations", [""+searchname+"","" + number + ""]]}"+);

the id,searchname and number are dynamic. This api will return all the names which match your search and return the account name with its reputation.

Implementing this in the app was the long part. The common search activity which plugged into the android search framework and was the place where you can display the users as well as the posts together.

searchss.png

alls.png

All the results are displayed on the same page. Not in tabs. I will see which is better and change it is needed.

How was it done?

  1. Created all the data classes.

  2. Created the searchable class for android.

  3. Experimented with the requests for users and for asksteem. Included the payout parameter in asksteem.

  4. plugged it all in my common recycler adapter and created the helper classes which have the bind functions.

  5. Created the header view and helper classes.

  6. Implemented the app theme.

  7. Left parts open so I can implement the page function if need be.

  8. Made the search class a singletop activity so not more than one can be open at a time.

  9. You can search from within the search activity.

  10. commit

  11. commit

Delete drafts

This was something I wanted to implement for a long time. The number of drafts can pile up sometimes so you need a way to delete them.

To implement this I created some helper functions and some interface functions.

  1. Confirm from the user if he wants to. Say no to ghost clicks.
  2. Delete the draft from the database.
  3. Remove that draft from the recycler view list.
  4. Tell the system that an item has been removed and it will update the ui.

draftdelete.png

  1. commit

open search on type and detect words on share

This set of changes will be helpful for the user. The behaviour might change according to the need.
For now If you have a physical keyboard attached to your phone/tablet then typing in the mainactivity will open search.

setDefaultKeyMode(Activity.DEFAULT_KEYS_SEARCH_LOCAL)

While sharing text with the app it will not only open urls, but if it detects a word then it will save it to the drafts db and forward you to the post activity.

  1. commit

Improvements and bug fixes

UI improvements

This change will make the article displays look much better and contain more information.
Overflow vector graphics. Colour changes and other ui changes to make the experience clean and good looking.
Capture+_2018-06-25-21-17-57.png

Say hi to @negativer

  1. commit
  2. commit

FAB improvements

The FAB button (the small circular button at the bottom) can be very useful and at the same time very a hindrance.
To hide the fab a class was implemented.
Since the ui uses different components I had to make different listeners for each in the class and hide the FAB according their parameters.

for a recycler view simply check if the y > 0 if yes then hide

for nested scroll view you have to compare the oldy to the newy

for scrollview you have to store the oldview yourself and check it to the newy
This was done for scrollview so I can maintain compatibility for older android versions.

Once the hard work was done, implementing the class was easy with just small interface changes to return the fab.

  1. commit
  2. commit

Multiple bug fixes

  1. Removed unique tag from the drafts db so it can save any draft.
  2. The loading bar in the drafts activity would continue to spin upon refreshing. This was fixed by a call to the stop function.
  3. When clicking very quickly going back and forth android would destroy the activity but the call to the network would return and would try to process with a null context. This would result in the app crashing. Put a null check to fix it.
  4. Main tags activity did not implement the app theme.
  5. The comment page did not implement the app theme entirely because android would not let the cardview go before the input. the text would be white and so would the background be. It is implemented correctly now by using the background color on my own as the windows would not show it and using the input as the background.

commit

Miscellaneous improvements

  1. Better Javascript and clean up of some code horror.
  2. Function to delete stale request data set at 6hrs.

commit
commit

GitHub account

https://github.com/hispeedimagins


The app is performing well and is almost ready for release. Why almost? Well because I noticed a small bug, not sure though in my followers and following dB. Will check it out and then ready for release.
Except the wallet features, I have covered all the features in my post
https://steemit.com/steem-dev/@hispeedimagins/app-update
3 months whew.
A lot of thanks goes to @utopian-io or the progress would have been much much slower.


AskSteem banner

Search

Sort:  

Commented out codes

You may improve your code commenting behaviors. I see you have lots of commented out code which is generally not useful for the developer reads the codebase. That is considered a bad practice.

Commit messages

I suggest reading How to write git commit messages post to produce better commit messages. While you put lots of useful text on message body, commit messages' headers are not descriptive.

Example, when I run a $ git log on your repository, I see this:

Screen Shot 2018-06-27 at 1.42.57 PM.png

Can't see what's happening here.

Thanks for the contribution.


Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

I had explained the commented out code before, I did not know kotlin before I started this project so I would save everything for later. I am cleaning it up slowly.
And as for the comments on the code, this app was not open source when I started it so I would not comment when a lot of code was written. After I made it open source that is when I started to add comments on the code.
I see your point about the headers though and go through that post.
Thanks :)

Commented out code can be really useful while developing though, to easily be able to switch to dummy functions.

so true, only God's write fluent beautiful code. We mortals make a mess first then clean-up as we progress. But oh well.

Hey @emrebeyler
Here's a tip for your valuable feedback! @Utopian-io loves and incentivises informative comments.

Contributing on Utopian
Learn how to contribute on our website.

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Hey @hispeedimagins
Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Coin Marketplace

STEEM 0.30
TRX 0.11
JST 0.033
BTC 64271.38
ETH 3157.43
USDT 1.00
SBD 4.25