Skip to content

Commit

Permalink
update UI for localizatoin and extract remaining strings
Browse files Browse the repository at this point in the history
  • Loading branch information
n8fr8 committed Nov 3, 2017
1 parent c8236b7 commit 2233edb
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ private void shareEvent ()
}

emailIntent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);
startActivity(Intent.createChooser(emailIntent, "Share event..."));
startActivity(Intent.createChooser(emailIntent, getString(R.string.share_event_action)));
}

private String generateLog () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void onBindViewHolder(EventVH holder, int position) {
Event event = events.get(position);

String title = event.getStartTime().toLocaleString();
String desc = event.getEventTriggers().size() + " triggered events";
String desc = event.getEventTriggers().size() + ' ' + context.getString(R.string.detection_events);

holder.title.setText(title);
holder.note.setText(desc);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void onBindViewHolder(EventTriggerVH holder, int position) {
final EventTrigger eventTrigger = eventTriggers.get(position);

String title = eventTrigger.getStringType();
String desc = eventTrigger.getTriggerTime().toString();
String desc = eventTrigger.getTriggerTime().toLocaleString();

holder.image.setVisibility(View.GONE);
holder.extra.setVisibility(View.GONE);
Expand Down Expand Up @@ -150,21 +150,21 @@ public boolean reportProgress(double fractionComplete) {
}
else if (eventTrigger.getType() == EventTrigger.ACCELEROMETER)
{
desc += "\nSPEED: " + eventTrigger.getPath();
desc += "\n" + context.getString(R.string.data_speed) + ": " + eventTrigger.getPath();

}
else if (eventTrigger.getType() == EventTrigger.LIGHT)
{
desc += "\nLIGHT: " + eventTrigger.getPath();
desc += "\n" + context.getString(R.string.data_light) + ": " + eventTrigger.getPath();

}
else if (eventTrigger.getType() == EventTrigger.PRESSURE)
{
desc += "\nCPRESSURE: " + eventTrigger.getPath();
desc += "\n" + context.getString(R.string.data_pressure) + ": " + eventTrigger.getPath();
}
else if (eventTrigger.getType() == EventTrigger.POWER)
{
desc += "\nPOWER: " + eventTrigger.getPath();
desc += "\n" + context.getString(R.string.data_power) + ": " + eventTrigger.getPath();
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void onClick(View v) {
PreferenceManager pm = new PreferenceManager(PPAppIntro.this);
pm.activateSms(true);
pm.setSmsNumber(cs4.getPhoneNumber());
Toast.makeText(PPAppIntro.this,"Phone number saved!",Toast.LENGTH_SHORT).show();
Toast.makeText(PPAppIntro.this, R.string.phone_saved,Toast.LENGTH_SHORT).show();
getPager().setCurrentItem(getPager().getCurrentItem()+1);
}
});
Expand Down
4 changes: 2 additions & 2 deletions src/main/res/layout/custom_slide_notify.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
android:id="@+id/custom_slide_big_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Know immediately when Haven detects something"
android:text="@string/know_immediately_when_haven_detects_something"
android:textColor="@color/colorPrimaryLight"
android:gravity="center"
android:layout_margin="10dp"
Expand All @@ -32,7 +32,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="You will receive a text when the app hears or sees something"
android:text="@string/you_will_receive_a_text_when_the_app_hears_or_sees_something"
android:textColor="@color/colorPrimaryLight"
android:gravity="center"
android:layout_marginLeft="40dp"
Expand Down
9 changes: 9 additions & 0 deletions src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,13 @@
<string name="action_cancel">Deactivate</string>
<string name="status_on">ACTIVE</string>
<string name="status_charging">Charging:</string>
<string name="you_will_receive_a_text_when_the_app_hears_or_sees_something">You will receive a text when the app hears or sees something</string>
<string name="know_immediately_when_haven_detects_something">Know immediately when Haven detects something</string>
<string name="phone_saved">Phone number saved!</string>
<string name="detection_events">detection events</string>
<string name="data_speed">SPEED</string>
<string name="data_light">LIGHT</string>
<string name="data_pressure">PRESSURE</string>
<string name="data_power">POWER</string>
<string name="share_event_action">Share event...</string>
</resources>

0 comments on commit 2233edb

Please sign in to comment.