Skip to content

Commit

Permalink
Further AlertList Orientation bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
jamorham committed Sep 29, 2016
1 parent 9ecc56f commit 08ffdef
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
9 changes: 9 additions & 0 deletions app/src/main/java/com/eveningoutpost/dexdrip/AlertList.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ public void onAnimationStart(Animation animation) {
// as well (or you can use the convenience method lv.setLongClickable(true);). This way you can have a list
// with only some items responding to longclick. (might be used for non removable alerts)

xdrip.checkForcedEnglish(xdrip.getAppContext());
Intent myIntent = new Intent(AlertList.this, EditAlertActivity.class);
myIntent.putExtra("uuid", item.get("uuid")); //Optional parameters
AlertList.this.startActivityForResult(myIntent, EDIT_ALERT);
Expand All @@ -128,6 +129,12 @@ public void onAnimationEnd(Animation animation) {
}
}

@Override
protected void onResume() {
xdrip.checkForcedEnglish(xdrip.getAppContext());
super.onResume();
}

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand Down Expand Up @@ -157,6 +164,7 @@ public void addListenerOnButton() {

createLowAlert.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
xdrip.checkForcedEnglish(xdrip.getAppContext());
Intent myIntent = new Intent(AlertList.this, EditAlertActivity.class);
myIntent.putExtra("above", "false");
AlertList.this.startActivityForResult(myIntent, ADD_ALERT);
Expand All @@ -166,6 +174,7 @@ public void onClick(View v) {

createHighAlert.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
xdrip.checkForcedEnglish(xdrip.getAppContext());
Intent myIntent = new Intent(AlertList.this, EditAlertActivity.class);
myIntent.putExtra("above", "true");
AlertList.this.startActivityForResult(myIntent, ADD_ALERT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
import java.util.ArrayList;

public class EditAlertActivity extends ActivityWithMenu {
public static String menu_name = "Edit Alert";
//public static String menu_name = "Edit Alert";

private TextView viewHeader;

Expand Down Expand Up @@ -114,9 +114,16 @@ String getExtra(Bundle savedInstanceState, String paramName, String defaultVal)
return defaultVal;
}
}


@Override
protected void onResume() {
xdrip.checkForcedEnglish(xdrip.getAppContext());
super.onResume();
}

@Override
protected void onCreate(Bundle savedInstanceState) {
xdrip.checkForcedEnglish(xdrip.getAppContext());
super.onCreate(savedInstanceState);
mContext = this;
setContentView(R.layout.activity_edit_alert);
Expand Down Expand Up @@ -285,7 +292,7 @@ public void onSaveInstanceState(Bundle outState){

@Override
public String getMenuName() {
return menu_name;
return getString(R.string.title_activity_edit_alert);
}


Expand Down

0 comments on commit 08ffdef

Please sign in to comment.