Steemer Release and update

in #utopian-io6 years ago (edited)

STEEMER-BANNER02.png

Repository

https://github.com/hispeedimagins/steem


steemer is and will remain the first native android app which is and will be forever completely free for the people to use.

Why free?

Because @steemit needs it. A quick way to interact with the blockchain. One that will not eat into their precious coins.


New features

Floating date headers

A UI addition which took sometime to implement was to a floating date header across the app so it is easy for users to know on which date the event took place.

sinsup3.png

The class which I created is simple and easy to implement. You only have to instantiate this class, include the layouts below and then each time you are adding something which has a date you one function passing it the date.

fun checktimeandaddQuestions(oldcc: Date)

This will compare the dates and handle adding them to the recyclerview and also update the Floating date header including the animations. How cool is that. It compares the dates using this line

var com = getZeroDate(prevdate).compareTo(getZeroDate(oldc))

if com is more than 0 then the prev date was bigger the the present one
else if com less than 0 then the opposite
and if the app has just started then a different condition is used.

The getZeroDate function is exactly as it's name states.

fun getZeroDate(od: Calendar?): Calendar {
val calendar = Calendar.getInstance()
calendar.time = od!!.time
calendar.set(Calendar.HOUR_OF_DAY, 0)
calendar.set(Calendar.MINUTE, 0)
calendar.set(Calendar.SECOND, 0)
calendar.set(Calendar.MILLISECOND, 0)
return calendar
}

A lot of issues are faced if the dates are not zeroed.

After this the animations are run, for above or below, as the case may be.

you have to add this layout below the recyclerview or the swiperefreshview

< include android:id="@+id/dateanim" layout="@layout/dateholderandanimator" / >

This has a frame layout so I floats on top of the layouts. Hence the name Floating date holder.

commits
  1. commit

Edit your articles

Yes, Now you can finally edit those pesky typo's and grammar mistakes from your posted articles and save yourself from a world of shame.

sinsup1.png

For editing articles on Steem you need to keep some things constant.

  1. The first tag in your tags or aka your category or aka parent permlink, this has to remain the same. Cannot change.
  2. The permlink has to remain the same.

Why?
Steem uses them to find your article and then edit it. If they are not the same then it will not find them and you risk posting an article to the chain instead of editing it.
Keeping the permlink the same is not difficult.

The first is.
I had to setup focus and text change listeners on the tags edittext. Then check if the tag started with the first tag, if not add it back and then check the number of tags.

if(categoryedit != null && !s.toString().startsWith(categoryedit!!)){
EditTextMainTwo?.setText("$categoryedit ${s.toString().trim()}")
} else{
checkString(s.toString())
}

Check string checks the number of tags and sets or removes error messages, as the case may be.

For saving to drafts and recovering from them, some changes had to be made to the drafts db and the extra data was saved as json.

var jso = JSONObject()
jso.put("isedit",true)
jso.put("permlink",holder?.article?.permlink)
jso.put("category",holder?.article?.category)

This is then recovered when opening a draft and it all works smoothly.

commits
  1. commit where you can edit your article
  2. commit where articles to be edited can be saved and recovered from drafts

Bug fixes & UI improvements

Fixed a bug where app would crash if the wrong name was entered while opening a blog

Open a blog was meant to open any users block quickly. But it did not handle two conditions:

  1. If the user entered upper case characters, the app would not convert them to lower case. Steem uses only lowercase in usernames.
  2. If the name did not match, the app would crash.

Fixing the first was easy.
The second was easy too. If the app returned no user, then we simply forward the request to the search activity handling everything gracefully.

sinsup4.png

commits
  1. commit

Ui bug where list background colour would make text invisible in dark theme

The list of trending display selector would be white while in the dark theme.

android:popupBackground="?attr/cardBackgroundColor"

This does not popup in the dialogue by android studio, had to spend time searching about it.

result
sinsup2.png

commits
  1. commit

Fixed the DB refresh bug.

The logic to keep the followers and the following databases refreshed had a bug where people you unfollowed would not reflect in the app. This was a bug with the logic to remove stale users.

What was happening?

alldbpeople.remove(x)
alldbpeople.remove(alldbpeople.find { t -> t.follower == x.follower })

I was using the first one instead of the second one. The logic would work, but I had added some extra fields and they would not be instantiated to the same values as the other list, rookie error. Now it looks in the list and removes it.
Then deletes the rest from the database.

commits
  1. commit

Fix a bug where refreshing the notifications activity would result in no views being loaded

The error was two fold.
The app would crash silently at one place because of the use of First() function which throws an exception if there are not items. Changing that to FirstOrNull() fixed the first part of the bug.

The second one was a silent one too. OkHttp library would start the websocketlistener as a background task.
When I would attempt to update the ui once the sync was completed via an interface android would throw a silent error which stated that only the thread which created the element can update it.

runOnUIThread
running it inside this function fixed the bug.

commits

commit

Fixed a bug where the app would crash if images were null

This was a bug which should not happen but it happened on one rare occasion for which I received the error report.

A simple fix. Just use FirstOrNull instead of get(i).

commits
  1. commit

Fixed a bug where sharing a url would open in post articles

changed regex to identify and spaces. Steem URL's do not contain spaces so this is a more accurate check.

commits
  1. commit

GitHub account

https://github.com/hispeedimagins


Please note I forgot to comment on code and had to do it later here. [comments](https://github.com/hispeedimagins/steem/commit/6304748e3339039a902f6331e8bc6a9212c88638)

Also since this app was not open source when I started it, I did not comment much. Only after I have put it on Github have I started adding comments.


Want to contact me?

Discord server for steemer - https://discord.gg/GkNZCGu
My discord username - hispeedimagins#6619
email - [email protected]

Sort:  
Loading...

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!

Congratulations! Your post has been selected as a daily Steemit truffle! It is listed on rank 4 of all contributions awarded today. You can find the TOP DAILY TRUFFLE PICKS HERE.

I upvoted your contribution because to my mind your post is at least 20 SBD worth and should receive 102 votes. It's now up to the lovely Steemit community to make this come true.

I am TrufflePig, an Artificial Intelligence Bot that helps minnows and content curators using Machine Learning. If you are curious how I select content, you can find an explanation here!

Have a nice day and sincerely yours,
trufflepig
TrufflePig

Coin Marketplace

STEEM 0.29
TRX 0.11
JST 0.034
BTC 66095.77
ETH 3184.92
USDT 1.00
SBD 4.12