Skip to content

Commit

Permalink
Allow articles which are to be edited saved, updated and forwarded wi…
Browse files Browse the repository at this point in the history
…th the correct parameters.

Stopped updating the settings value in drafts db so saved edited data like parent permlink is persisted and non updateable,
added the check for no data and parse the data as JSONObject to forward paramters to the Post activity
  • Loading branch information
hispeedimagins committed Jul 3, 2018
1 parent d6e2aa0 commit f3721af
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
Expand Up @@ -17,6 +17,7 @@ import com.steemapp.lokisveil.steemapp.Enums.AdapterToUseFor
import com.steemapp.lokisveil.steemapp.Interfaces.arvdinterface
import com.steemapp.lokisveil.steemapp.MyViewHolders.DraftViewHolder
import com.steemapp.lokisveil.steemapp.jsonclasses.OperationJson
import org.json.JSONObject

class draftHelperFunctions (context : Context, username:String?, adapter: AllRecyclerViewAdapter, adpterType: AdapterToUseFor) {
val con: Context = context
Expand Down Expand Up @@ -82,9 +83,25 @@ class draftHelperFunctions (context : Context, username:String?, adapter: AllRec
//mholder.openarticle
mholder.openarticle?.setOnClickListener(View.OnClickListener {
//ForReturningQuestionsLite q = item;
//var db = drafts(con)

//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)
if(holder.article?.payouttype != ""){
var jso = JSONObject(holder.article?.payouttype)
var ised:Boolean = if(jso.has("isedit")) jso.getBoolean("isedit") else false
if(ised){
myIntent.putExtra("isedit",ised)
myIntent.putExtra("permlink",jso.getString("permlink"))
myIntent.putExtra("category",jso.getString("category"))
}

}


/*val myIntent = Intent(con, Post::class.java)
myIntent.putExtra("db", holder.article?.dbid)*/
/* myIntent.putExtra("tag", holder.article?.category)
myIntent.putExtra("permlink", holder.article?.permlink)*/
con.startActivity(myIntent)
Expand Down
Expand Up @@ -71,7 +71,7 @@ class drafts(context : Context) : SQLiteOpenHelper(context, DatabaseName,null, D
values.put(DatabaseColoumnTitle, title)
values.put(DatabaseColoumnTags, tags)
values.put(DatabaseColoumnContent, content)
values.put(DatabaseColoumnPostValue, postvalue)
//values.put(DatabaseColoumnPostValue, postvalue)
var date = Date()

values.put(DatabaseColoumnDate, date.time.toString())
Expand Down

0 comments on commit f3721af

Please sign in to comment.