This file contains hidden or 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
<android.support.design.widget.AppBarLayout | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content"> | |
<android.support.v7.widget.Toolbar | |
android:id="@id/toolbar" | |
android:layout_width="match_parent" | |
android:layout_height="?attr/actionBarSize"> | |
<ImageView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" |
This file contains hidden or 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
<style name="AppTheme.Toolbar" parent="AppTheme"> | |
<!--This line changes the color of text in Toolbar--> | |
<item name="android:textColorPrimary">@color/green</item> | |
<!--This line changes the color of icons in toolbar (back, overflow menu icons)--> | |
<item name="android:textColorSecondary">@color/green</item> | |
</style |
This file contains hidden or 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
<android.support.v7.widget.Toolbar | |
android:id="@+id/toolbar" | |
android:layout_width="match_parent" | |
android:layout_height="?attr/actionBarSize" | |
android:background="?attr/colorPrimary" | |
app:theme="@style/AppTheme.Toolbar" /> |
This file contains hidden or 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
<activity ...> | |
<intent-filter android:autoVerify="true"> | |
<action android:name="android.intent.action.VIEW" /> | |
<category android:name="android.intent.category.DEFAULT" /> | |
<category android:name="android.intent.category.BROWSABLE" /> | |
<data android:scheme="http" android:host="www.example.com" /> | |
<data android:scheme="https" /> | |
</intent-filter> |
This file contains hidden or 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
[{ | |
"relation": ["delegate_permission/common.handle_all_urls"], | |
"target": { | |
"namespace": "android_app", | |
"package_name": "com.example", | |
"sha256_cert_fingerprints": | |
["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"] | |
} | |
}] |
This file contains hidden or 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 AlarmReceiver : BroadcastReceiver() { | |
override fun onReceive(context: Context, intent: Intent) { | |
/* enqueue the job */ | |
AlarmJobIntentService.enqueueWork(context, intent) | |
} | |
companion object { |
This file contains hidden or 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 AlarmJobIntentService : JobIntentService() { | |
override fun onHandleWork(intent: Intent) { | |
/* your code here */ | |
/* reset the alarm */ | |
// Util.showDebugLog("setAlarmCtx", "started Bottom") | |
AlarmReceiver.setAlarm(false) | |
stopSelf() | |
} |
This file contains hidden or 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
<receiver android:name=".AlarmReceiver" | |
android:permission="android.permission.BIND_JOB_SERVICE"> | |
<intent-filter> | |
<action android:name="com.test.intent.action.ALARM" /> | |
</intent-filter> | |
</receiver> | |
<service android:name=".AlarmJobIntentService" /> |
This file contains hidden or 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
Notification notification = new NotificationCompat.Builder(this); | |
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { | |
notification.setSmallIcon(R.drawable.icon_transperent); | |
notification.setColor(getResources().getColor(R.color.notification_color)); | |
} else { | |
notification.setSmallIcon(R.drawable.icon); | |
} |
This file contains hidden or 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"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:orientation="vertical" | |
tools:context=".MainActivity"> | |
<Button | |
android:layout_width="wrap_content" |