Skip to content

Commit

Permalink
Add comments to important changes
Browse files Browse the repository at this point in the history
will add comments to the important changes. Not all of them.
  • Loading branch information
hispeedimagins committed Jul 6, 2018
1 parent 1609944 commit 6304748
Show file tree
Hide file tree
Showing 14 changed files with 44 additions and 1 deletion.
Binary file modified app/release/app-release.apk
Binary file not shown.
2 changes: 1 addition & 1 deletion app/release/output.json
@@ -1 +1 @@
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":35,"versionName":"1.4.3","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":36,"versionName":"1.4.4","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
Expand Up @@ -214,6 +214,7 @@ class FeedHelperFunctions(context : Context,username:String?,adapter:AllRecycler
//.error(R.drawable.error)
.priority(Priority.HIGH)

//use first of null so the app does not crash if not images exist
Glide.with(con).load(holder.article?.image?.firstOrNull()).apply(optionss)
//.placeholder(R.drawable.common_full_open_on_phone)
.into(holder.article_image as ImageView)
Expand Down
Expand Up @@ -42,6 +42,7 @@ class FloatingDateHolder {
super.onScrollStateChanged(recyclerView, newState)
}

//listner to the recycleview so the date can be updated in the frame layout
override fun onScrolled(recyclerView: RecyclerView?, dx: Int, dy: Int) {
super.onScrolled(recyclerView, dx, dy)
val visibleItemCount = recyclerView!!.childCount
Expand Down Expand Up @@ -124,6 +125,7 @@ class FloatingDateHolder {

}

//the only constructor used atm
constructor(con: Context, view: View, recyclerView: RecyclerView, recyclerViewAdapter: AllRecyclerViewAdapter) {

this.view = view
Expand Down Expand Up @@ -172,6 +174,10 @@ class FloatingDateHolder {
}


//Used to add a DateYpeAndString into the recyclerview
/*
for adding the datetypeandstring object to the class
*/
fun add(datetosend: String, cd: Calendar): DateTypeAndStringHolder {
val h = DateTypeAndStringHolder()
h.cdate = cd
Expand Down Expand Up @@ -214,6 +220,7 @@ class FloatingDateHolder {
}


//Used to check if the date is in the past,now, or for an empty view
fun checktimeandaddQuestions(oldcc: Date) {

/*Calendar oldc = new GregorianCalendar(TimeZone.getTimeZone("GMT"));
Expand Down Expand Up @@ -253,6 +260,7 @@ class FloatingDateHolder {
prevdate = oldc
}

//for getting only the date back, no time,hour,minute second or milliseconds.
fun getZeroDate(od: Calendar?): Calendar {
val calendar = Calendar.getInstance()

Expand All @@ -265,6 +273,7 @@ class FloatingDateHolder {
return calendar
}

//Bind function called by the main recyclerview adapter to bind the view
fun BindDateToDateTitle(holder: RecyclerView.ViewHolder, position: Int) {
if (holder !is DateViewHolder) {
return
Expand All @@ -281,6 +290,7 @@ class FloatingDateHolder {
}


//for animating the view
private fun animateToEnd() {
val animation = TranslateAnimation(0f, 0f, 0f, 200f)
animation.duration = 1000
Expand All @@ -290,6 +300,7 @@ class FloatingDateHolder {
}


//called for updating the main sticky frame layout
private fun updateStickyHeader(prevdate: String, newdate: String, holder: DateTypeAndStringHolder, previsbiggerthannext: Boolean) {

if (holderOldUnivDate != null && holder.equals(holderOldUnivDate)) {
Expand Down
Expand Up @@ -88,10 +88,13 @@ class draftHelperFunctions (context : Context, username:String?, adapter: AllRec
//var dbid = db.Insert(holder?.article?.title!!,tags,holder?.article?.body!!,jso.toString())
val myIntent = Intent(con, Post::class.java)
myIntent.putExtra("db", holder.article?.dbid)
//check for older version saved data
if(holder.article?.payouttype != ""){
//simply put the string in the constructor to get JSOnObject
var jso = JSONObject(holder.article?.payouttype)
var ised:Boolean = if(jso.has("isedit")) jso.getBoolean("isedit") else false
if(ised){
//add additional parameters to intent
myIntent.putExtra("isedit",ised)
myIntent.putExtra("permlink",jso.getString("permlink"))
myIntent.putExtra("category",jso.getString("category"))
Expand Down
Expand Up @@ -69,6 +69,7 @@ class FollowersDatabase(context : Context) : SQLiteOpenHelper(context, CentralCo
}


//For deleting with Id
fun deleteContact(id: Long?): Int? {
val db = this.writableDatabase

Expand Down Expand Up @@ -102,6 +103,7 @@ class FollowersDatabase(context : Context) : SQLiteOpenHelper(context, CentralCo
follower = cursor.getString(cursor.getColumnIndex(DatabaseColoumnFollower)),
following = cursor.getString(cursor.getColumnIndex(DatabaseColoumnFollowing)),
what = rl,
//return dbid as well for deletion
dbid = cursor.getLong(cursor.getColumnIndex(DatabaseColoumnId))
)

Expand Down
Expand Up @@ -71,6 +71,7 @@ class drafts(context : Context) : SQLiteOpenHelper(context, DatabaseName,null, D
values.put(DatabaseColoumnTitle, title)
values.put(DatabaseColoumnTags, tags)
values.put(DatabaseColoumnContent, content)
//do not update the postvalue
//values.put(DatabaseColoumnPostValue, postvalue)
var date = Date()

Expand Down
Expand Up @@ -357,23 +357,28 @@ class ArticleFragment : Fragment() , GlobalInterface {



// decide if edit is to be used
if(username != null && username == holder.article?.author){
holder.article_edit?.visibility = View.VISIBLE
holder.article_edit?.setOnClickListener(View.OnClickListener {
if(context != null){
var tags = ""
if(holder.article?.tags != null){
var sb = StringBuilder()
//flatten the tags
for(x in holder.article?.tags!!){
sb.append("$x ")
}
tags = sb.toString().trim()
var db = drafts(context!!)
//json object for saving additional information
var jso = JSONObject()
jso.put("isedit",true)
jso.put("permlink",holder?.article?.permlink)
jso.put("category",holder?.article?.category)
//save to db
var dbid = db.Insert(holder?.article?.title!!,tags,holder?.article?.body!!,jso.toString())
//add to intent and start the view
val myIntent = Intent(context, Post::class.java)
myIntent.putExtra("db", dbid)
myIntent.putExtra("isedit",true)
Expand Down
Expand Up @@ -156,13 +156,16 @@ class WritePost : Fragment() {
EditTextMainThreehandler = TextInputLayoutErrorHandler(v.findViewById(R.id.EditMainTextThreeTextLayout) as TextInputLayout)


//for listening if the text has changed
EditTextMainTwo?.addTextChangedListener(object : TextWatcher {

override fun afterTextChanged(s: Editable) {

//if the first tag has changed, put it back
if(categoryedit != null && !s.toString().startsWith(categoryedit!!)){
EditTextMainTwo?.setText("$categoryedit ${s.toString().trim()}")
} else{
//if not check the string length and show and error if more than the limit for 10
checkString(s.toString())
}

Expand All @@ -178,6 +181,7 @@ class WritePost : Fragment() {
}
})

//focus on edittextmaintwo listner
EditTextMainTwo?.setOnFocusChangeListener({v, hasFocus ->
var tagsth = gettags()
if(tagsth != null && tagsth.isNotEmpty()){
Expand Down Expand Up @@ -245,6 +249,10 @@ class WritePost : Fragment() {
}
}

/**
* checks the length of the tags and inserts errors where needed.
* @var tagsth is the tag string
*/
fun checkString(tagsth:String?){
//var tagsth = gettags()
if(tagsth != null && tagsth.isNotEmpty()){
Expand Down
Expand Up @@ -213,8 +213,10 @@ class GeneralRequestsFeedIntoConstants(context: Context) {
for(x in followers){
x.followInternal = MyOperationTypes.follow
if(fold.Insert(x)){
//search for the user and delte from the list
alldbpeople.remove(alldbpeople.find { t -> t.follower == x.follower })
} else {
//search for the user and delte from the list
alldbpeople.remove(alldbpeople.find { t -> t.follower == x.follower })
}
}
Expand Down Expand Up @@ -287,8 +289,10 @@ class GeneralRequestsFeedIntoConstants(context: Context) {
for(x in following){
x.followInternal = MyOperationTypes.follow
if(fold.Insert(x)){
//search for the user and delte from the list
alldbpeople.remove(alldbpeople.find { t -> t.following == x.following })
} else {
//search for the user and delte from the list
alldbpeople.remove(alldbpeople.find { t -> t.following == x.following })
}
}
Expand Down
Expand Up @@ -204,6 +204,7 @@ class NotificationsWebSocketListener(username:String?,context:Context?) : WebSoc

//.setGroupAlertBehavior(GROUP_ALERT_SUMMARY)

//Will not let it crash. use FirstOrNull instead of first
.setWhen(((if(om.firstOrNull() != null) om.firstOrNull()?.timestamp!!.toLong() else 1) * 1000))
.setGroupSummary(true)
var s = NotificationCompat.InboxStyle()
Expand Down
Expand Up @@ -48,6 +48,7 @@ class NotificationsBusyD : AppCompatActivity(),NotificationsInterface {

override fun dbLoaded() {
//client = null
//websocket is run on the background thread so run ui updates on the right thread
runOnUiThread {
adapter?.notificationsBusyHelperFunctions?.resetDate()
val db = NotificationsBusyDb(this@NotificationsBusyD)
Expand Down
Expand Up @@ -606,10 +606,14 @@ class OpenOtherGuyBlog : AppCompatActivity() ,GlobalInterface {
}
}
} else{
//Start the intent creation
var inte = Intent(this@OpenOtherGuyBlog,SearchActivity::class.java)
//used to easy compatibility
inte.putExtra(SearchManager.QUERY,username)
//add so not extra code has to be written
inte.action = Intent.ACTION_SEARCH
startActivity(inte)
//close this activity
finish()
}

Expand Down
2 changes: 2 additions & 0 deletions app/src/main/java/com/steemapp/lokisveil/steemapp/Post.kt
Expand Up @@ -225,6 +225,8 @@ class Post : AppCompatActivity() , GlobalInterface, BeneficiaryAddInterface {


if(isedit){
//a different function called if it is for editing a post
//different enum used for GetDynamicAndBlock
var ops = mine.updatePost(AccountName(username),Permlink(permlinkedit),title,content, tags?.split(" ")?.toTypedArray())
val block = GetDynamicAndBlock(applicationContext, null, 0, ops, "posted $title", MyOperationTypes.edit_comment, writePost?.progressBar, this@Post)
block.GetDynamicGlobalProperties()
Expand Down

0 comments on commit 6304748

Please sign in to comment.