Skip to content

Commit

Permalink
Adding a close buttin in the Settings Modal (#166)
Browse files Browse the repository at this point in the history
- Should be dismiss to the parent
- Added close buttons
- refactored the onSaveInstances

Signed-off-by: kcw-grunt <[email protected]>
  • Loading branch information
kcw-grunt authored Mar 29, 2024
1 parent d599baf commit ef0f4a2
Show file tree
Hide file tree
Showing 31 changed files with 144 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,5 +129,7 @@ public void onBackPressed() {

@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,10 @@ private void clearWords() {

@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
}

private class FocusListener implements View.OnFocusChangeListener {
private class FocusListener implements View.OnFocusChangeListener {

@Override
public void onFocusChange(View v, boolean hasFocus) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,6 @@ public int getCount() {

@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ private boolean isWordCorrect(boolean first) {

@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
}

// private class FocusListener implements View.OnFocusChangeListener {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,5 +179,6 @@ public void onComplete() {

@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -148,5 +148,7 @@ public void run() {

@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -201,5 +201,6 @@ private void setMode(int mode) {

@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -957,5 +957,6 @@ public void onBackPressed() {

@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -172,5 +172,6 @@ private void initQRCodeReaderView() {

@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ protected void onPause() {

@Override
protected void onSaveInstanceState(Bundle outState) {

super.onSaveInstanceState(outState);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,6 @@ public void onBackPressed() {

@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@

public class WriteDownActivity extends BRActivity {
private Button writeButton;
private ImageButton close;
private ImageButton closeButton;

public static boolean appVisible = false;
private static WriteDownActivity app;

Expand All @@ -31,14 +32,27 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_write_down);

writeButton = (Button) findViewById(R.id.button_write_down);
close = (ImageButton) findViewById(R.id.close_button);
close.setOnClickListener(new View.OnClickListener() {
// close = (ImageButton) findViewById(R.id.close_button);
// close.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// close();
// }
// });

closeButton = (ImageButton) findViewById(R.id.close_button);
closeButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
close();
onBackPressed();
}
});

// public void onBackPressed() {
// super.onBackPressed();
// overridePendingTransition(R.anim.fade_up, R.anim.exit_to_bottom);
// }

//TODO: all views are using the layout of this button. Views should be refactored without it
// Hiding until layouts are built.
ImageButton faq = (ImageButton) findViewById(R.id.faq_button);
Expand Down Expand Up @@ -78,6 +92,7 @@ protected void onPause() {

@Override
public void onBackPressed() {
super.onBackPressed();
if (getFragmentManager().getBackStackEntryCount() == 0) {
close();
} else {
Expand All @@ -93,6 +108,7 @@ private void close() {

@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;

Expand All @@ -29,6 +30,8 @@ public class AboutActivity extends BRActivity {
private ImageView blogShare;
private static AboutActivity app;

private ImageButton closeButton;

public static AboutActivity getApp() {
return app;
}
Expand All @@ -37,6 +40,7 @@ public static AboutActivity getApp() {

@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
}

@Override
Expand Down Expand Up @@ -85,6 +89,14 @@ public void onClick(View v) {
}
});

closeButton = (ImageButton) findViewById(R.id.close_button);
closeButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});

}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ public void onClick(View v) {

@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,15 @@ public class DisplayCurrencyActivity extends BRActivity {
private Button leftButton;
private Button rightButton;

private ImageButton closeButton;

public static DisplayCurrencyActivity getApp() {
return app;
}

@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
}

@Override
Expand Down Expand Up @@ -100,6 +103,15 @@ public void onItemClick(AdapterView<?> parent, View view,
});
listView.setAdapter(adapter);
adapter.notifyDataSetChanged();


closeButton = (ImageButton) findViewById(R.id.close_button);
closeButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
}

private void updateExchangeRate() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public static FingerprintActivity getApp() {

@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class ImportActivity extends BRActivity {
private static final String TAG = ImportActivity.class.getName();
public static boolean appVisible = false;
private static ImportActivity app;
private ImageButton close;
private ImageButton closeButton;

public static ImportActivity getApp() {
return app;
Expand All @@ -31,8 +31,8 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_import);

scan = (Button) findViewById(R.id.scan_button);
close = (ImageButton) findViewById(R.id.close_button);
close.setOnClickListener(new View.OnClickListener() {
closeButton = (ImageButton) findViewById(R.id.close_button);
closeButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
Expand Down Expand Up @@ -67,6 +67,7 @@ protected void onPause() {

@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public static NodesActivity getApp() {

@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public static NotificationActivity getApp() {

@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public static SecurityCenterActivity getApp() {

@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,20 @@
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.CompoundButton;
import android.widget.ImageButton;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.ToggleButton;

import androidx.annotation.LayoutRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.breadwallet.R;
import com.breadwallet.presenter.activities.DisabledActivity;
import com.breadwallet.presenter.activities.InputWordsActivity;
import com.breadwallet.presenter.language.ChangeLanguageBottomSheet;
import com.breadwallet.presenter.activities.util.BRActivity;
import com.breadwallet.presenter.entities.BRSettingsItem;
Expand All @@ -35,18 +41,21 @@ public class SettingsActivity extends BRActivity {
private ListView listView;
public List<BRSettingsItem> items;
public static boolean appVisible = false;
private ImageButton closeButton;
private static SettingsActivity app;

public static SettingsActivity getApp() {
return app;
}

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_settings);


listView = findViewById(R.id.settings_list);

closeButton = (ImageButton) findViewById(R.id.close_button);
closeButton.setOnClickListener(v -> finish());
}

public class SettingsListAdapter extends ArrayAdapter<String> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public void onBackPressed() {

@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,11 @@ public class SpendLimitActivity extends BRActivity {
private ListView listView;
private LimitAdaptor adapter;

private ImageButton closeButton;

@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
}

public static SpendLimitActivity getApp() {
Expand All @@ -56,6 +59,7 @@ protected void onCreate(Bundle savedInstanceState) {
// Hiding until layouts are built.
ImageButton faq = findViewById(R.id.faq_button);

closeButton = (ImageButton) findViewById(R.id.close_button);
listView = findViewById(R.id.limit_list);
listView.setFooterDividersEnabled(true);
adapter = new LimitAdaptor(this);
Expand Down Expand Up @@ -83,6 +87,13 @@ public void onItemClick(AdapterView<?> parent, View view,
});
listView.setAdapter(adapter);
adapter.notifyDataSetChanged();

closeButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
}

//satoshis
Expand Down
Loading

0 comments on commit ef0f4a2

Please sign in to comment.