Adds night mode

This commit is contained in:
tom79 2017-06-30 17:09:07 +02:00
parent f4800666e9
commit f7321b788d
55 changed files with 336 additions and 57 deletions

View File

@ -40,7 +40,7 @@
android:launchMode="singleTop"
android:windowSoftInputMode="stateAlwaysHidden"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@style/AppTheme.NoActionBar">
android:theme="@style/AppTheme_NoActionBar">
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
@ -114,6 +114,8 @@
/>
<activity
android:name="fr.gouv.etalab.mastodon.activities.SplashActivity"
android:windowSoftInputMode="stateAlwaysHidden"
android:configChanges="orientation|screenSize"
android:theme="@style/SplashTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

View File

@ -15,6 +15,7 @@
package fr.gouv.etalab.mastodon.activities;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.net.Uri;
@ -49,6 +50,13 @@ public class AboutActivity extends AppCompatActivity implements OnRetrieveSearcA
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_LIGHT);
if( theme == Helper.THEME_LIGHT){
setTheme(R.style.AppTheme);
}else {
setTheme(R.style.AppThemeDark);
}
if( getSupportActionBar() != null)
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
setContentView(R.layout.activity_about);

View File

@ -21,6 +21,7 @@ import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.MenuItem;
import android.view.View;
import android.widget.AbsListView;
@ -62,8 +63,19 @@ public class HashTagActivity extends AppCompatActivity implements OnRetrieveFeed
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_LIGHT);
if( theme == Helper.THEME_LIGHT){
setTheme(R.style.AppTheme);
}else {
setTheme(R.style.AppThemeDark);
}
setContentView(R.layout.activity_hashtag);
if( getSupportActionBar() != null)
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
Bundle b = getIntent().getExtras();
@ -77,9 +89,11 @@ public class HashTagActivity extends AppCompatActivity implements OnRetrieveFeed
firstLoad = true;
boolean isOnWifi = Helper.isOnWIFI(getApplicationContext());
swipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipeContainer);
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
int behaviorWithAttachments = sharedpreferences.getInt(Helper.SET_ATTACHMENT_ACTION, Helper.ATTACHMENT_ALWAYS);
final ListView lv_status = (ListView) findViewById(R.id.lv_status);
tootsPerPage = sharedpreferences.getInt(Helper.SET_TOOTS_PER_PAGE, 40);
mainLoader = (RelativeLayout) findViewById(R.id.loader);

View File

@ -16,6 +16,7 @@ package fr.gouv.etalab.mastodon.activities;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Build;
@ -55,6 +56,13 @@ public class InstanceActivity extends AppCompatActivity implements OnRetrieveIns
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_LIGHT);
if( theme == Helper.THEME_LIGHT){
setTheme(R.style.AppTheme);
}else {
setTheme(R.style.AppThemeDark);
}
if( getSupportActionBar() != null)
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
setContentView(R.layout.activity_instance);

View File

@ -69,6 +69,13 @@ public class LoginActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_LIGHT);
if( theme == Helper.THEME_LIGHT){
setTheme(R.style.AppTheme);
}else {
setTheme(R.style.AppThemeDark);
}
setContentView(R.layout.activity_login);
final Button connectionButton = (Button) findViewById(R.id.login_button);

View File

@ -25,6 +25,7 @@ import android.support.annotation.NonNull;
import android.support.design.widget.FloatingActionButton;
import android.support.v4.app.FragmentManager;
import android.support.v7.app.AlertDialog;
import android.util.Log;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
@ -101,6 +102,14 @@ public class MainActivity extends AppCompatActivity
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_LIGHT);
if( theme == Helper.THEME_LIGHT){
setTheme(R.style.AppTheme_NoActionBar);
}else {
setTheme(R.style.AppThemeDark_NoActionBar);
}
setContentView(R.layout.activity_main);
//Test if user is still log in
if( ! Helper.isLoggedIn(getApplicationContext())) {
@ -152,7 +161,6 @@ public class MainActivity extends AppCompatActivity
headerLayout = navigationView.getHeaderView(0);
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
String prefKeyOauthTokenT = sharedpreferences.getString(Helper.PREF_KEY_OAUTH_TOKEN, null);
Account account = new AccountDAO(getApplicationContext(), db).getAccountByToken(prefKeyOauthTokenT);
updateHeaderAccountInfo(MainActivity.this, account, headerLayout, imageLoader, options);
@ -225,6 +233,7 @@ public class MainActivity extends AppCompatActivity
private boolean mamageNewIntent(Intent intent){
if( intent == null || intent.getExtras() == null )
return false;
String action = intent.getAction();
String type = intent.getType();
Bundle extras = intent.getExtras();
@ -389,7 +398,7 @@ public class MainActivity extends AppCompatActivity
}
}
//Open the search bar
final EditText search = new EditText(getApplicationContext());
final EditText search = new EditText(MainActivity.this);
search.setSingleLine(true);
search.setLayoutParams( new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,

View File

@ -16,6 +16,7 @@ package fr.gouv.etalab.mastodon.activities;
import android.Manifest;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.media.MediaPlayer;
@ -101,6 +102,14 @@ public class MediaActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_LIGHT);
if( theme == Helper.THEME_LIGHT){
setTheme(R.style.AppTheme);
}else {
setTheme(R.style.AppThemeDark);
}
setContentView(R.layout.activity_media);
attachments = getIntent().getParcelableArrayListExtra("mediaArray");
mediaPosition = getIntent().getExtras().getInt("position", 1);

View File

@ -15,9 +15,12 @@
package fr.gouv.etalab.mastodon.activities;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
import fr.gouv.etalab.mastodon.helper.Helper;
import mastodon.etalab.gouv.fr.mastodon.R;
@ -31,6 +34,13 @@ public class PrivacyActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_LIGHT);
if( theme == Helper.THEME_LIGHT){
setTheme(R.style.AppTheme);
}else {
setTheme(R.style.AppThemeDark);
}
if( getSupportActionBar() != null)
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
setContentView(R.layout.activity_privacy);

View File

@ -52,6 +52,13 @@ public class SearchResultActivity extends AppCompatActivity implements OnRetriev
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_LIGHT);
if( theme == Helper.THEME_LIGHT){
setTheme(R.style.AppTheme);
}else {
setTheme(R.style.AppThemeDark);
}
setContentView(R.layout.activity_search_result);
loader = (RelativeLayout) findViewById(R.id.loader);

View File

@ -105,9 +105,15 @@ public class ShowAccountActivity extends AppCompatActivity implements OnPostActi
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_LIGHT);
if( theme == Helper.THEME_LIGHT){
setTheme(R.style.AppTheme);
}else {
setTheme(R.style.AppThemeDark);
}
setContentView(R.layout.activity_show_account);
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
imageLoader = ImageLoader.getInstance();
statuses = new ArrayList<>();
boolean isOnWifi = Helper.isOnWIFI(getApplicationContext());

View File

@ -56,6 +56,14 @@ public class ShowConversationActivity extends AppCompatActivity implements OnRet
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_LIGHT);
if( theme == Helper.THEME_LIGHT){
setTheme(R.style.AppTheme);
}else {
setTheme(R.style.AppThemeDark);
}
setContentView(R.layout.activity_show_conversation);
if( getSupportActionBar() != null)

View File

@ -28,7 +28,6 @@ public class SplashActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent = new Intent(this, MainActivity.class);
startActivity(intent);
finish();

View File

@ -116,6 +116,13 @@ public class TootActivity extends AppCompatActivity implements OnRetrieveSearcAc
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_LIGHT);
if( theme == Helper.THEME_LIGHT){
setTheme(R.style.AppTheme);
}else {
setTheme(R.style.AppThemeDark);
}
setContentView(R.layout.activity_toot);
if( getSupportActionBar() != null)
@ -182,7 +189,6 @@ public class TootActivity extends AppCompatActivity implements OnRetrieveSearcAc
}
if( tootReply != null) {
setTitle(R.string.toot_title_reply);
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
String userId = sharedpreferences.getString(Helper.PREF_KEY_ID, null);
boolean show_reply = sharedpreferences.getBoolean(Helper.SET_SHOW_REPLY, false);
if( show_reply ){
@ -269,7 +275,6 @@ public class TootActivity extends AppCompatActivity implements OnRetrieveSearcAc
FloatingActionButton toot_close_accounts = (FloatingActionButton) findViewById(R.id.toot_close_accounts);
SQLiteDatabase db = Sqlite.getInstance(getApplicationContext(), Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
String userId = sharedpreferences.getString(Helper.PREF_KEY_ID, null);
Account account = new AccountDAO(getApplicationContext(),db).getAccountByID(userId);
boolean isAccountPrivate = account.isLocked();

View File

@ -16,6 +16,7 @@ package fr.gouv.etalab.mastodon.activities;
import android.Manifest;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Bundle;
@ -54,6 +55,13 @@ public class WebviewActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_LIGHT);
if( theme == Helper.THEME_LIGHT){
setTheme(R.style.AppTheme);
}else {
setTheme(R.style.AppThemeDark);
}
setContentView(R.layout.activity_webview);
Bundle b = getIntent().getExtras();
if(b != null)

View File

@ -58,6 +58,13 @@ public class WebviewConnectActivity extends AppCompatActivity {
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_LIGHT);
if( theme == Helper.THEME_LIGHT){
setTheme(R.style.AppTheme);
}else {
setTheme(R.style.AppThemeDark);
}
setContentView(R.layout.activity_webview_connect);
Bundle b = getIntent().getExtras();
if(b != null)
@ -65,7 +72,6 @@ public class WebviewConnectActivity extends AppCompatActivity {
if( instance == null)
finish();
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
clientId = sharedpreferences.getString(Helper.CLIENT_ID, null);
clientSecret = sharedpreferences.getString(Helper.CLIENT_SECRET, null);

View File

@ -30,6 +30,7 @@ import android.text.Html;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.ArrayAdapter;
import android.widget.BaseAdapter;
import android.widget.Button;
@ -196,6 +197,7 @@ public class StatusListAdapter extends BaseAdapter implements OnPostActionInterf
}else{
holder.status_account_displayname.setCompoundDrawables( null, null, null, null);
}
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
//Click on a conversation
if( type != RetrieveFeedsAsyncTask.Type.CONTEXT ){
holder.status_content.setOnClickListener(new View.OnClickListener() {
@ -209,10 +211,19 @@ public class StatusListAdapter extends BaseAdapter implements OnPostActionInterf
}
});
}else {
if( position == ShowConversationActivity.position){
holder.main_container.setBackgroundResource(R.color.blue_light);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_LIGHT);
if( theme == Helper.THEME_LIGHT){
if( position == ShowConversationActivity.position){
holder.main_container.setBackgroundResource(R.color.blue_light);
}else {
holder.main_container.setBackgroundResource(R.color.white);
}
}else {
holder.main_container.setBackgroundResource(R.color.white);
if( position == ShowConversationActivity.position){
holder.main_container.setBackgroundResource(R.color.header2D);
}else {
holder.main_container.setBackgroundResource(R.color.cardview_dark_background);
}
}
}
@ -354,7 +365,7 @@ public class StatusListAdapter extends BaseAdapter implements OnPostActionInterf
holder.status_favorite_count.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
boolean confirmation = sharedpreferences.getBoolean(Helper.SET_NOTIF_VALIDATION, true);
if( confirmation )
displayConfirmationDialog(FAVOURITE,status);
@ -366,7 +377,6 @@ public class StatusListAdapter extends BaseAdapter implements OnPostActionInterf
holder.status_reblog_count.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
boolean confirmation = sharedpreferences.getBoolean(Helper.SET_NOTIF_VALIDATION, true);
if( confirmation )
displayConfirmationDialog(REBLOG,status);
@ -635,7 +645,7 @@ public class StatusListAdapter extends BaseAdapter implements OnPostActionInterf
String userId = sharedpreferences.getString(Helper.PREF_KEY_ID, null);
final boolean isOwner = status.getAccount().getId().equals(userId);
AlertDialog.Builder builderSingle = new AlertDialog.Builder(context);
builderSingle.setTitle(R.string.make_a_choice);
//builderSingle.setTitle(R.string.make_a_choice);
final String[] stringArray, stringArrayConf;
final API.StatusAction[] doAction;
if( isOwner) {
@ -752,6 +762,7 @@ public class StatusListAdapter extends BaseAdapter implements OnPostActionInterf
builderInner.show();
}
});
builderSingle.create().requestWindowFeature(Window.FEATURE_NO_TITLE);
builderSingle.show();
}
}

View File

@ -173,6 +173,24 @@ public class SettingsFragment extends Fragment {
file_chooser.setVisibility(View.GONE);
}
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_LIGHT);
final SwitchCompat set_night_mode = (SwitchCompat) rootView.findViewById(R.id.set_night_mode);
set_night_mode.setChecked(theme == Helper.THEME_DARK);
set_night_mode.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putInt(Helper.SET_THEME, isChecked?Helper.THEME_DARK:Helper.THEME_LIGHT);
editor.apply();
if( isChecked){
getActivity().setTheme(R.style.AppThemeDark);
}else {
getActivity().setTheme(R.style.AppTheme);
}
getActivity().recreate();
}
});
return rootView;
}

View File

@ -157,10 +157,12 @@ public class Helper {
public static final String SET_ACCOUNTS_PER_PAGE = "set_accounts_per_page";
public static final String SET_NOTIFICATIONS_PER_PAGE = "set_notifications_per_page";
public static final String SET_ATTACHMENT_ACTION = "set_attachment_action";
public static final String SET_THEME = "set_theme";
public static final int ATTACHMENT_ALWAYS = 1;
public static final int ATTACHMENT_WIFI = 2;
public static final int ATTACHMENT_ASK = 3;
public static final int THEME_LIGHT = 1;
public static final int THEME_DARK = 2;
public static final String SET_NOTIF_FOLLOW = "set_notif_follow";
public static final String SET_NOTIF_ADD = "set_notif_follow_add";
@ -177,6 +179,7 @@ public class Helper {
public static final String SET_JAVASCRIPT = "set_javascript";
public static final String SET_COOKIES = "set_cookies";
public static final String SET_FOLDER_RECORD = "set_folder_record";
//End points
public static final String EP_AUTHORIZE = "/oauth/authorize";

Binary file not shown.

Before

Width:  |  Height:  |  Size: 287 B

After

Width:  |  Height:  |  Size: 808 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 265 B

After

Width:  |  Height:  |  Size: 416 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 222 B

After

Width:  |  Height:  |  Size: 495 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 347 B

After

Width:  |  Height:  |  Size: 1011 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 472 B

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 595 B

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/colorAccentD" />
<stroke android:width="1dp" android:color="@color/colorPrimary" />
<padding android:left="1dp" android:top="1dp" android:right="1dp"
android:bottom="1dp" />
</shape>

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle" >
<solid android:color="@android:color/transparent" />
</shape>
</item>
<item android:top="-2dp" android:right="-2dp" android:left="-2dp">
<shape>
<solid android:color="@android:color/transparent" />
<stroke
android:width="1dp"
android:color="@color/colorPrimaryD" />
</shape>
</item>
</layer-list>

View File

@ -0,0 +1,9 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:angle="135"
android:centerColor="@color/header2D"
android:endColor="@color/header1D"
android:startColor="@color/header3D"
android:type="linear" />
</shape>

View File

@ -18,7 +18,6 @@
<ScrollView android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
android:background="#fff"
xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"

View File

@ -113,14 +113,13 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_marginTop="5dp"
android:layout_width="match_parent"
android:background="@android:color/white"
android:background="@null"
android:layout_height="wrap_content">
<android.support.design.widget.TabLayout
android:id="@+id/account_tabLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/white"
app:tabTextAppearance="@android:style/TextAppearance.Widget.TabWidget"
app:tabMode="fixed"
app:tabGravity="fill"
@ -129,7 +128,6 @@
android:id="@+id/account_viewpager"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/white"
/>
</android.support.design.widget.AppBarLayout>

View File

@ -18,7 +18,6 @@
<ScrollView android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
android:background="#fff"
xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"

View File

@ -39,7 +39,7 @@
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay" />
app:popupTheme="?attr/popupOverlay" />
</android.support.design.widget.AppBarLayout>

View File

@ -32,14 +32,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:layout_marginTop="10dp"
android:layout_marginTop="20dp"
android:orientation="vertical"
tools:ignore="UselessParent">
<!-- PRIVACY TITLE -->
<TextView
android:text="@string/privacy_API_title"
android:background="@drawable/shape_border_bottom_settings"
style="?attr/shapeBorder"
android:paddingBottom="10dp"
android:layout_marginBottom="10dp"
android:layout_width="match_parent"
@ -64,7 +64,7 @@
<!-- DATA PRIVACY TITLE -->
<TextView
android:text="@string/privacy_data_title"
android:background="@drawable/shape_border_bottom_settings"
style="?attr/shapeBorder"
android:paddingBottom="10dp"
android:layout_marginBottom="10dp"
android:layout_width="match_parent"
@ -81,6 +81,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="vertical"
tools:ignore="UselessParent">
@ -88,7 +89,7 @@
<!-- APPS AUTHORIZATIONS TITLE -->
<TextView
android:text="@string/privacy_authorizations_title"
android:background="@drawable/shape_border_bottom_settings"
style="?attr/shapeBorder"
android:paddingBottom="10dp"
android:layout_marginBottom="10dp"
android:layout_width="match_parent"
@ -106,13 +107,15 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:orientation="vertical"
tools:ignore="UselessParent">
<!-- API AUTHORIZATIONS TITLE -->
<TextView
android:text="@string/privacy_API_authorizations_title"
android:background="@drawable/shape_border_bottom_settings"
style="?attr/shapeBorder"
android:paddingBottom="10dp"
android:layout_marginBottom="10dp"
android:layout_width="match_parent"

View File

@ -111,15 +111,14 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_marginTop="5dp"
android:background="@null"
android:layout_width="match_parent"
android:background="@android:color/white"
android:layout_height="wrap_content">
<android.support.design.widget.TabLayout
android:id="@+id/account_tabLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/white"
app:tabTextAppearance="@android:style/TextAppearance.Widget.TabWidget"
app:tabMode="fixed"
app:tabGravity="fill"
@ -128,7 +127,6 @@
android:id="@+id/account_viewpager"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/white"
/>
</android.support.design.widget.AppBarLayout>

View File

@ -50,7 +50,6 @@
android:layout_below="@+id/dialog_profile_picture"
android:layout_centerHorizontal="true"
android:textSize="18sp"
android:textColor="@color/white"
android:gravity="center_horizontal|top"
android:id="@+id/dialog_profile_name"
android:layout_width="match_parent"
@ -65,7 +64,6 @@
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:id="@+id/dialog_profile_description"
android:minLines="4"
android:lines="4"

View File

@ -20,6 +20,7 @@
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:card_view="http://schemas.android.com/tools"
style="?attr/cardStyle"
android:layout_marginTop="10dp"
card_view:cardPreventCornerOverlap="true"
app:cardUseCompatPadding="true">

View File

@ -21,6 +21,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:card_view="http://schemas.android.com/tools"
android:layout_marginTop="10dp"
style="?attr/cardStyle"
card_view:cardPreventCornerOverlap="true"
app:cardUseCompatPadding="true">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
@ -58,7 +59,6 @@
android:layout_marginLeft="5dp"
android:layout_gravity="end"
android:gravity="center"
android:textColor="@color/white"
style="@style/Base.Widget.AppCompat.Button.Small"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
@ -69,7 +69,6 @@
android:text="@string/reject"
android:layout_gravity="end"
android:gravity="center"
android:textColor="@color/white"
style="@style/Base.Widget.AppCompat.Button.Small"
android:layout_width="match_parent"
android:layout_height="wrap_content" />

View File

@ -21,6 +21,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:card_view="http://schemas.android.com/tools"
android:layout_marginTop="10dp"
style="?attr/cardStyle"
card_view:cardPreventCornerOverlap="true"
app:cardUseCompatPadding="true">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

View File

@ -21,6 +21,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:card_view="http://schemas.android.com/tools"
android:layout_marginTop="10dp"
style="?attr/cardStyle"
card_view:cardPreventCornerOverlap="true"
app:cardUseCompatPadding="true">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

View File

@ -21,6 +21,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:card_view="http://schemas.android.com/tools"
android:layout_marginTop="10dp"
style="?attr/cardStyle"
card_view:cardPreventCornerOverlap="true"
app:cardUseCompatPadding="true">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

View File

@ -20,6 +20,7 @@
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:card_view="http://schemas.android.com/tools"
style="?attr/cardStyle"
android:layout_marginTop="10dp"
card_view:cardPreventCornerOverlap="true"
app:cardUseCompatPadding="true">
@ -54,7 +55,7 @@
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:background="@drawable/imageview_border"
style="?attr/shapeBorder"
android:visibility="gone"
tools:ignore="ContentDescription" />
</RelativeLayout>

View File

@ -21,6 +21,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:card_view="http://schemas.android.com/tools"
android:layout_marginTop="10dp"
style="?attr/cardStyle"
card_view:cardPreventCornerOverlap="true"
app:cardUseCompatPadding="true">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

View File

@ -22,6 +22,7 @@
xmlns:card_view="http://schemas.android.com/tools"
android:layout_marginTop="10dp"
card_view:cardPreventCornerOverlap="true"
style="?attr/cardStyle"
app:cardUseCompatPadding="true">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"

View File

@ -75,7 +75,7 @@
android:layout_marginStart="10dp"
android:maxLines="2"
android:textStyle="italic"
android:textColor="@color/colorAccent"
android:textColor="?attr/colorAccent"
android:id="@+id/set_folder"
android:layout_width="0dp"
android:layout_weight="1"
@ -142,7 +142,25 @@
/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_night_mode"/>
<android.support.v7.widget.SwitchCompat
android:id="@+id/set_night_mode"
android:layout_gravity="center_vertical"
android:gravity="center"
android:layout_margin="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
</LinearLayout>
</ScrollView>

View File

@ -36,7 +36,7 @@
<!-- NOTIFICATIONS SETTINGS -->
<TextView
android:text="@string/settings_title_notifications"
android:background="@drawable/shape_border_bottom_settings"
style="?attr/shapeBorder"
android:paddingBottom="10dp"
android:layout_marginBottom="10dp"
android:layout_width="match_parent"
@ -72,7 +72,7 @@
<!-- NOTIFICATION CONTENT NEW -->
<TextView
android:text="@string/set_title_news"
android:background="@drawable/shape_border_bottom_settings"
style="?attr/shapeBorder"
android:paddingBottom="10dp"
android:layout_marginBottom="10dp"
android:layout_width="match_parent"
@ -86,7 +86,7 @@
<!-- MORE OPTIONS SETTINGS -->
<TextView
android:text="@string/settings_title_more_options"
android:background="@drawable/shape_border_bottom_settings"
style="?attr/shapeBorder"
android:paddingBottom="10dp"
android:paddingTop="10dp"
android:layout_marginBottom="10dp"

View File

@ -36,7 +36,7 @@
<!-- OPTIMIZATION SETTINGS -->
<TextView
android:text="@string/settings_title_optimisation"
android:background="@drawable/shape_border_bottom_settings"
style="?attr/shapeBorder"
android:paddingBottom="10dp"
android:layout_width="match_parent"
android:layout_marginBottom="10dp"

View File

@ -35,7 +35,7 @@
<!-- Profile SETTINGS -->
<TextView
android:text="@string/settings_title_profile"
android:background="@drawable/shape_border_bottom_settings"
style="?attr/shapeBorder"
android:paddingBottom="10dp"
android:layout_width="match_parent"
android:layout_marginBottom="10dp"

View File

@ -19,7 +19,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="@dimen/nav_header_height"
android:background="@drawable/side_nav_bar"
style="?attr/headerbg"
android:gravity="bottom"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"

View File

@ -25,7 +25,6 @@
android:id="@+id/picture_actionbar"
android:maxLines="1"
android:layout_width="match_parent"
android:textColor="@color/white"
android:layout_height="wrap_content"
android:textSize="14sp" />
</LinearLayout>

View File

@ -49,7 +49,6 @@
android:id="@+id/loader"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
android:layout_gravity="center"
android:gravity="center"
>

View File

@ -19,6 +19,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:background="@null"
android:layout_height="match_parent">
<android.support.design.widget.TabLayout
@ -26,7 +27,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabMaxWidth="0dp"
android:background="@android:color/white"
app:tabMode="scrollable"
app:tabGravity="fill"
/>
@ -35,7 +35,6 @@
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
/>
</android.support.design.widget.AppBarLayout>

View File

@ -22,7 +22,6 @@
android:orientation="horizontal"
tools:ignore="UseCompoundDrawables">
<ImageView
android:background="@color/white"
android:layout_gravity="center_vertical"
android:id="@+id/webview_favicon"
android:layout_width="20dp"
@ -35,7 +34,6 @@
android:id="@+id/webview_title"
android:maxLines="1"
android:layout_width="0dp"
android:textColor="@color/white"
android:layout_height="wrap_content"
android:textSize="12sp"
android:layout_weight="1" />

View File

@ -6,7 +6,6 @@
<menu>
<group android:checkableBehavior="single">
<item
android:checked="true"
android:id="@+id/nav_home"
android:icon="@drawable/ic_action_home"
android:title="@string/home_menu" />

View File

@ -1,17 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- LIGHT -->
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#2196F3</color>
<!-- DARK -->
<color name="colorPrimaryD">#616161</color>
<color name="colorPrimaryDarkD">#212121</color>
<color name="colorAccentD">#009688</color>
<!-- Header Profile-->
<color name="header1">#0288D1</color>
<color name="header2">#03A9F4</color>
<color name="header3">#4FC3F7</color>
<!-- Header Profile DARK-->
<color name="header1D">#263238</color>
<color name="header2D">#455A64</color>
<color name="header3D">#607D8B</color>
<color name="dark_text">#BDBDBD</color>
<color name="transparent">#00000000</color>
<color name="splashc">#F5F5F5</color>
<color name="splashc_dark">#546E7A</color>
<color name="white">#FFF</color>
<color name="blue_light">#C5CAE9</color>
@ -24,4 +37,6 @@
<color name="green_1">#009688</color>
<color name="red_1">#F44336</color>
<color name="black">#000</color>
</resources>

View File

@ -243,7 +243,7 @@
<string name="settings_title_more_options">Options avancées</string>
<string name="set_wifi_only">Notifier en WIFI seulement</string>
<string name="set_notif_silent">Utiliser le vibreur</string>
<string name="set_night_mode">Mode nuit</string>
<string name="settings_title_profile">Modifier le profil</string>
<string name="set_profile_description">Présentation…</string>
<string name="set_save_changes">Enregistrer les modifications</string>
@ -281,7 +281,6 @@
Seules les informations de base des comptes connectés sont enregistrées sur l\'appareil.
Ces données sont strictement confidentielles et ne sont utilisables que par l\'application. La suppression de l\'application entraîne immédiatement la suppression de ces données.\n
&#9888; Les identifiants et les mots de passe ne sont jamais enregistrés, ils ne sont utilisés que lors de l\'authentification sécurisée (SSL) vers l\'instance.
</string>
<string name="privacy_authorizations_title">Autorisations de l\'application</string>
@ -291,7 +290,7 @@
- <b>WRITE_EXTERNAL_STORAGE</b> : Utilisée pour télécharger les médias / déplacer sur la carte SD.\n
- <b>READ_EXTERNAL_STORAGE</b> : Utilisée pour ajouter des médias aux pouets.\n
- <b>BOOT_COMPLETED</b> : Utilisée pour lancer le service de notifications quand l\'appareil démarre.\n
- <b>WAKE_LOCK</b> : Utilisée lors du service de notifications.\n
- <b>WAKE_LOCK</b> : Utilisée lors du service de notifications.
</string>
<string name="privacy_API_authorizations_title">Autorisations de l\'API</string>
@ -299,7 +298,7 @@
- <b>Read</b> : Lire les données du compte.\n
- <b>Write</b> : Envoyer des messages et attacher des médias aux messages.\n
- <b>Follow</b> : S\'abonner, se désabonner, bloquer, débloquer.\n\n
<b>&#9888; Ces actions ne sont réalisées qu\'à la demande de l\'utilisateur.</b>\n\n
<b>&#9888; Ces actions ne sont réalisées qu\'à la demande de l\'utilisateur.</b>
</string>
<string name="privacy_API_title">Suivi et bibliothèques</string>
<string name="privacy_API">

View File

@ -1,24 +1,103 @@
<resources>
<attr format="reference" name="cardStyle"/>
<attr format="reference" name="appBarLayout"/>
<attr format="reference" name="headerbg"/>
<attr format="reference" name="shapeBorder"/>
<attr format="reference" name="imgbd"/>
<attr format="reference" name="splash"/>
<attr format="reference" name="popupOverlay"/>
<attr format="reference" name="appBarOverlay"/>
<!-- Base application theme. -->
<!-- Light theme -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="cardStyle">@style/CardView.Light</item>
<item name="headerbg">@style/Header.Light</item>
<item name="shapeBorder">@style/Shape.Light</item>
<item name="imgbd">@style/Image.Border.Light</item>
<item name="popupOverlay">@style/AppTheme.PopupOverlay</item>
</style>
<style name="AppTheme_NoActionBar" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="cardStyle">@style/CardView.Light</item>
<item name="headerbg">@style/Header.Light</item>
<item name="shapeBorder">@style/Shape.Light</item>
<item name="imgbd">@style/Image.Border.Light</item>
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="popupOverlay">@style/AppTheme.PopupOverlay</item>
</style>
<style name="AppTheme.NoActionBar">
<!-- Dark theme -->
<style name="AppThemeDark" parent="Theme.AppCompat">
<item name="cardStyle">@style/CardView.Dark</item>
<item name="headerbg">@style/Header.Dark</item>
<item name="shapeBorder">@style/Shape.Dark</item>
<item name="imgbd">@style/Image.Border.Dark</item>
<item name="popupOverlay">@style/AppThemeDark.PopupOverlay</item>
</style>
<style name="AppThemeDark_NoActionBar" parent="Theme.AppCompat.NoActionBar">
<item name="cardStyle">@style/CardView.Dark</item>
<item name="headerbg">@style/Header.Dark</item>
<item name="shapeBorder">@style/Shape.Dark</item>
<item name="imgbd">@style/Image.Border.Dark</item>
<item name="popupOverlay">@style/AppThemeDark.PopupOverlay</item>
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppThemeDark.PopupOverlay" parent="ThemeOverlay.AppCompat.Dark">
</style>
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
<style name="SplashTheme" parent="Theme.AppCompat.NoActionBar">
<item name="android:windowBackground">@drawable/background_splash</item>
</style>
<style name="Image.Border.Dark" parent="AppThemeDark">
<item name="android:background">@drawable/imageview_border_dark</item>
</style>
<style name="Image.Border.Light" parent="AppTheme">
<item name="android:background">@drawable/imageview_border</item>
</style>
<style name="Header.Dark" parent="AppThemeDark">
<item name="android:background">@drawable/side_nav_bar_dark</item>
</style>
<style name="Header.Light" parent="AppTheme">
<item name="android:background">@drawable/side_nav_bar</item>
</style>
<style name="Shape.Dark" parent="AppThemeDark">
<item name="android:background">@drawable/shape_border_bottom_settings_dark</item>
</style>
<style name="Shape.Light" parent="AppTheme">
<item name="android:background">@drawable/shape_border_bottom_settings</item>
</style>
<style name="CardViewStyle.Dark" parent="CardView">
<item name="cardBackgroundColor">@color/cardview_dark_background</item>
</style>
<style name="CardViewStyle.Light" parent="CardView">
<item name="cardBackgroundColor">@color/cardview_light_background</item>
</style>
</resources>