Skip to content

Commit

Permalink
Added string resources
Browse files Browse the repository at this point in the history
  • Loading branch information
Akash Bisariya committed Feb 9, 2018
1 parent 10f9eb0 commit 9ed228c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
RelativeLayout constraintLayout = (RelativeLayout) findViewById(R.id.cl_home);

/*
Animated drawable on home screen
*/
animationDrawable = (AnimationDrawable) constraintLayout.getBackground();
animationDrawable.setEnterFadeDuration(2000);
animationDrawable.setExitFadeDuration(3000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ protected void onHandleIntent(Intent intent) {
String message = "";
GeofencingEvent geofencingEvent = GeofencingEvent.fromIntent(intent);
if (geofencingEvent.getGeofenceTransition() == Geofence.GEOFENCE_TRANSITION_ENTER) {
message = "Entering In the Geofence";
message = getString(R.string.txt_enter_geofence);
Log.e("GeoFenceService", "Entering Geofence");
} else if (geofencingEvent.getGeofenceTransition() == Geofence.GEOFENCE_TRANSITION_EXIT) {
message = "Exiting from the Geofence";
message = getString(R.string.txt_exiting_geofence);
Log.e("GeoFenceService", "Exiting Geofence");
}
NotificationCompat.Builder mBuilder =
new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.cast_ic_notification_small_icon)
.setContentTitle("Geofence Notification")
.setContentTitle(getString(R.string.txt_notification_title))
.setContentText(message);

// Sets an ID for the notification
Expand Down
16 changes: 0 additions & 16 deletions app/src/main/res/layout/activity_sample.xml

This file was deleted.

3 changes: 3 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
<resources>
<string name="app_name">GeoFencingYou</string>
<string name="txt_enter_geofence">Entering In the Geofence</string>
<string name="txt_exiting_geofence">Exiting from the Geofence</string>
<string name="txt_notification_title">Geofence Notification</string>
</resources>

0 comments on commit 9ed228c

Please sign in to comment.