This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
contentList.forEach { | |
if (it.commentID == -1 && it.feedID == -1) { | |
val content = it | |
FeedItemBindingModel_() | |
.id(it.id) | |
.content(it) | |
.listener(View.OnClickListener { | |
feedID = content.id | |
recycler_view.requestModelBuild() | |
showSoftKeyboard(edit_content) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<layout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools"> | |
<data> | |
<variable name="content" type="com.example.epoxydemo.Content" /> | |
<variable | |
name="listener" | |
type="android.view.View.OnClickListener"/> | |
<variable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private var broadcastReceiver: BroadcastReceiver = object : BroadcastReceiver() { | |
override fun onReceive(context: Context, intent: Intent) { | |
if(intent.hasExtra(CHECKED)) | |
{ | |
println("broadcast received with intent") | |
MySliceProvider.state = intent.getBooleanExtra(CHECKED, false) | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<provider | |
android:name=".MySliceProvider" | |
android:authorities="com.bhaideveloper.slices" | |
android:exported="true" | |
android:grantUriPermissions="true"> | |
</provider> | |
<receiver android:name=".MyReceiver"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyReceiver : BroadcastReceiver() { | |
companion object { | |
var CHECKED = "CHECKED" | |
} | |
override fun onReceive(context: Context, intent: Intent) { | |
if(intent.hasExtra(CHECKED)) | |
{ | |
MySliceProvider.state = intent.getBooleanExtra(CHECKED,state) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
companion object { | |
fun getUri(context: Context, path: String): Uri { | |
return Uri.Builder() | |
.scheme(ContentResolver.SCHEME_CONTENT) | |
.authority(context.packageName) | |
.appendPath(path) | |
.build() | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override fun onBindSlice(sliceUri: Uri): Slice? { | |
return if (sliceUri.path == "/task") { | |
// Path recognized. Customize the Slice using the androidx.slice.builders API. | |
// Note: ANR and StrictMode are enforced here so don't do any heavy operations. | |
// Only bind data that is currently available in memory. | |
ListBuilder(context, sliceUri, INFINITY) | |
.addRow {it.setTitle("Task Completed? ") | |
it.setPrimaryAction(createActivityAction()) | |
it.addEndItem(createToggleAction(!state)) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<fragment | |
android:id="@+id/listingFragment" | |
android:name="com.bhaicompany.kotlinarchitecturalcomponents.fragments.ListingFragment" | |
android:label="Listing Fragment"> | |
<deepLink app:uri="www.example.com/{myarg}" /> | |
</fragment> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val args = ListingFragmentArgs.fromBundle(arguments) | |
println(args.query) |
NewerOlder