summaryrefslogtreecommitdiffstats
path: root/app/src/main/java/fr/gouv/etalab/mastodon/activities/ListActivity.java
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/fr/gouv/etalab/mastodon/activities/ListActivity.java')
-rw-r--r--app/src/main/java/fr/gouv/etalab/mastodon/activities/ListActivity.java18
1 files changed, 14 insertions, 4 deletions
diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/activities/ListActivity.java b/app/src/main/java/fr/gouv/etalab/mastodon/activities/ListActivity.java
index 4864d4221..2338457a7 100644
--- a/app/src/main/java/fr/gouv/etalab/mastodon/activities/ListActivity.java
+++ b/app/src/main/java/fr/gouv/etalab/mastodon/activities/ListActivity.java
@@ -38,10 +38,10 @@ import android.widget.EditText;
import android.widget.RelativeLayout;
import android.widget.Toast;
-
import java.util.ArrayList;
import java.util.List;
+import es.dmoral.toasty.Toasty;
import fr.gouv.etalab.mastodon.R;
import fr.gouv.etalab.mastodon.asynctasks.ManageListsAsyncTask;
import fr.gouv.etalab.mastodon.asynctasks.RetrieveFeedsAsyncTask;
@@ -130,7 +130,7 @@ public class ListActivity extends BaseActivity implements OnListActionInterface
title = b.getString("title");
listId = b.getString("id");
}else{
- Toast.makeText(this,R.string.toast_error_search,Toast.LENGTH_LONG).show();
+ Toasty.error(this,getString(R.string.toast_error_search),Toast.LENGTH_LONG).show();
}
if( getSupportActionBar() != null)
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
@@ -215,7 +215,17 @@ public class ListActivity extends BaseActivity implements OnListActionInterface
startActivity(intent);
return true;
case R.id.action_edit_list:
- AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(ListActivity.this);
+ int style;
+ SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
+ int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
+ if (theme == Helper.THEME_DARK) {
+ style = R.style.DialogDark;
+ } else if (theme == Helper.THEME_BLACK){
+ style = R.style.DialogBlack;
+ }else {
+ style = R.style.Dialog;
+ }
+ AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(ListActivity.this, style);
LayoutInflater inflater = getLayoutInflater();
@SuppressLint("InflateParams") View dialogView = inflater.inflate(R.layout.add_list, null);
dialogBuilder.setView(dialogView);
@@ -267,7 +277,7 @@ public class ListActivity extends BaseActivity implements OnListActionInterface
//Discards 404 - error which can often happen due to toots which have been deleted
if (apiResponse.getError() != null) {
if ( !apiResponse.getError().getError().startsWith("404 -"))
- Toast.makeText(ListActivity.this, apiResponse.getError().getError(), Toast.LENGTH_LONG).show();
+ Toasty.error(ListActivity.this, apiResponse.getError().getError(), Toast.LENGTH_LONG).show();
swipeRefreshLayout.setRefreshing(false);
swiped = false;
flag_loading = false;