Changes some sizes and colors

This commit is contained in:
tom79 2017-08-13 18:31:44 +02:00
parent c07735c988
commit 119cd75645
14 changed files with 96 additions and 74 deletions

View File

@ -26,11 +26,11 @@
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application
android:name="fr.gouv.etalab.mastodon.activities.MainApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:hardwareAccelerated="true"
android:name="fr.gouv.etalab.mastodon.activities.MainApplication"
android:roundIcon="@mipmap/ic_launcher"
android:supportsRtl="true"
android:theme="@style/AppThemeDark">

View File

@ -90,7 +90,7 @@ public class LoginActivity extends AppCompatActivity {
if( theme == Helper.THEME_DARK) {
changeDrawableColor(getApplicationContext(), R.drawable.mastodon_icon, R.color.mastodonC2);
}else {
changeDrawableColor(getApplicationContext(), R.drawable.mastodon_icon, R.color.mastodonC4);
changeDrawableColor(getApplicationContext(), R.drawable.mastodon_icon, R.color.mastodonC3);
}
final Button connectionButton = (Button) findViewById(R.id.login_button);
login_instance = (AutoCompleteTextView) findViewById(R.id.login_instance);

View File

@ -83,7 +83,6 @@ import static fr.gouv.etalab.mastodon.helper.Helper.HOME_TIMELINE_INTENT;
import static fr.gouv.etalab.mastodon.helper.Helper.INTENT_ACTION;
import static fr.gouv.etalab.mastodon.helper.Helper.NOTIFICATION_INTENT;
import static fr.gouv.etalab.mastodon.helper.Helper.PREF_KEY_ID;
import static fr.gouv.etalab.mastodon.helper.Helper.changeDrawableColor;
import static fr.gouv.etalab.mastodon.helper.Helper.changeUser;
import static fr.gouv.etalab.mastodon.helper.Helper.loadPPInActionBar;
import static fr.gouv.etalab.mastodon.helper.Helper.menuAccounts;

View File

@ -15,9 +15,7 @@ package fr.gouv.etalab.mastodon.activities;
* see <http://www.gnu.org/licenses>. */
import android.app.Application;
import android.os.StrictMode;
import com.evernote.android.job.JobManager;
import fr.gouv.etalab.mastodon.jobs.ApplicationJob;
import fr.gouv.etalab.mastodon.jobs.HomeTimelineSyncJob;
import fr.gouv.etalab.mastodon.jobs.NotificationsSyncJob;
@ -39,6 +37,5 @@ public class MainApplication extends Application{
HomeTimelineSyncJob.schedule(false);
StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
StrictMode.setVmPolicy(builder.build());
}
}

View File

@ -1213,14 +1213,27 @@ public class TootActivity extends AppCompatActivity implements OnRetrieveSearcAc
private void changeColor(){
changeDrawableColor(TootActivity.this, R.drawable.ic_action_globe,R.color.dark_text);
changeDrawableColor(TootActivity.this, R.drawable.ic_action_lock_open,R.color.dark_text);
changeDrawableColor(TootActivity.this, R.drawable.ic_action_lock_closed,R.color.dark_text);
changeDrawableColor(TootActivity.this, R.drawable.ic_local_post_office,R.color.dark_text);
changeDrawableColor(TootActivity.this, R.drawable.ic_action_camera,R.color.dark_text);
changeDrawableColor(TootActivity.this, R.drawable.ic_skip_previous,R.color.dark_text);
changeDrawableColor(TootActivity.this, R.drawable.ic_skip_next,R.color.dark_text);
changeDrawableColor(TootActivity.this, R.drawable.ic_check,R.color.dark_text);
final SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
if( theme == Helper.THEME_DARK) {
changeDrawableColor(TootActivity.this, R.drawable.ic_action_globe, R.color.dark_text);
changeDrawableColor(TootActivity.this, R.drawable.ic_action_lock_open, R.color.dark_text);
changeDrawableColor(TootActivity.this, R.drawable.ic_action_lock_closed, R.color.dark_text);
changeDrawableColor(TootActivity.this, R.drawable.ic_local_post_office, R.color.dark_text);
changeDrawableColor(TootActivity.this, R.drawable.ic_action_camera, R.color.dark_text);
changeDrawableColor(TootActivity.this, R.drawable.ic_skip_previous, R.color.dark_text);
changeDrawableColor(TootActivity.this, R.drawable.ic_skip_next, R.color.dark_text);
changeDrawableColor(TootActivity.this, R.drawable.ic_check, R.color.dark_text);
}else {
changeDrawableColor(TootActivity.this, R.drawable.ic_action_globe, R.color.white);
changeDrawableColor(TootActivity.this, R.drawable.ic_action_lock_open, R.color.white);
changeDrawableColor(TootActivity.this, R.drawable.ic_action_lock_closed, R.color.white);
changeDrawableColor(TootActivity.this, R.drawable.ic_local_post_office, R.color.white);
changeDrawableColor(TootActivity.this, R.drawable.ic_action_camera, R.color.white);
changeDrawableColor(TootActivity.this, R.drawable.ic_skip_previous, R.color.white);
changeDrawableColor(TootActivity.this, R.drawable.ic_skip_next, R.color.white);
changeDrawableColor(TootActivity.this, R.drawable.ic_check, R.color.white);
}
}

View File

@ -293,7 +293,7 @@ public class StatusListAdapter extends BaseAdapter implements OnPostActionInterf
changeDrawableColor(context, R.drawable.ic_fav_black,R.color.black);
changeDrawableColor(context, R.drawable.ic_photo,R.color.black);
changeDrawableColor(context, R.drawable.ic_remove_red_eye,R.color.black);
changeDrawableColor(context, R.drawable.ic_translate,R.color.black);
changeDrawableColor(context, R.drawable.ic_translate,R.color.white);
style = R.style.AlertDialog;
}

View File

@ -32,6 +32,7 @@ import android.provider.DocumentsContract;
import android.provider.MediaStore;
import android.support.v4.app.Fragment;
import android.support.v7.widget.SwitchCompat;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -70,6 +71,7 @@ public class SettingsFragment extends Fragment {
private static final int ACTIVITY_CHOOSE_FILE = 411;
private TextView set_folder;
private int style;
int count = 0;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
@ -334,26 +336,26 @@ public class SettingsFragment extends Fragment {
int positionSpinner = (sharedpreferences.getInt(Helper.SET_TABS, Helper.THEME_TABS) - 1);
tabs_layout_spinner.setSelection(positionSpinner);
tabs_layout_spinner.post(new Runnable() {
public void run() {
tabs_layout_spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putInt(Helper.SET_TABS, (position + 1));
editor.apply();
Helper.switchLayout(getActivity());
getActivity().recreate();
Intent intent = new Intent(context, MainActivity.class);
intent.putExtra(INTENT_ACTION, CHANGE_THEME_INTENT);
startActivity(intent);
}
tabs_layout_spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
if( count > 0){
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putInt(Helper.SET_TABS, (position + 1));
editor.apply();
Helper.switchLayout(getActivity());
getActivity().recreate();
Intent intent = new Intent(context, MainActivity.class);
intent.putExtra(INTENT_ACTION, CHANGE_THEME_INTENT);
startActivity(intent);
}else {
count++;
}
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
}
});
@ -370,10 +372,10 @@ public class SettingsFragment extends Fragment {
changeDrawableColor(context, R.drawable.ic_action_lock_closed,R.color.dark_text);
changeDrawableColor(context, R.drawable.ic_local_post_office,R.color.dark_text);
}else {
changeDrawableColor(context, R.drawable.ic_action_globe,R.color.black);
changeDrawableColor(context, R.drawable.ic_action_lock_open,R.color.black);
changeDrawableColor(context, R.drawable.ic_action_lock_closed,R.color.black);
changeDrawableColor(context, R.drawable.ic_local_post_office,R.color.black);
changeDrawableColor(context, R.drawable.ic_action_globe,R.color.white);
changeDrawableColor(context, R.drawable.ic_action_lock_open,R.color.white);
changeDrawableColor(context, R.drawable.ic_action_lock_closed,R.color.white);
changeDrawableColor(context, R.drawable.ic_local_post_office,R.color.white);
}
}

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/mastodonC4_" android:state_pressed="true" />
<item android:drawable="@color/mastodonC4__" android:state_enabled="false" />
<item android:drawable="@color/mastodonC4" />
</selector>

View File

@ -3,5 +3,5 @@
<item android:drawable="@color/mastodonC4" android:state_checked="true" />
<item android:drawable="@color/mastodonC4" android:state_pressed="true" />
<item android:drawable="@color/mastodonC4" android:state_focused="true" />
<item android:drawable="@color/mastodonC2" />
<item android:drawable="@color/mastodonC3__" />
</selector>

View File

@ -12,7 +12,7 @@
<solid android:color="@android:color/transparent" />
<stroke
android:width="1dp"
android:color="@color/mastodonC2" />
android:color="@color/mastodonC3__" />
</shape>
</item>

View File

@ -2,8 +2,8 @@
android:shape="rectangle">
<gradient
android:angle="135"
android:centerColor="@color/mastodonC2"
android:endColor="@color/mastodonC2"
android:startColor="@color/mastodonC2"
android:centerColor="@color/mastodonC1__"
android:endColor="@color/mastodonC1__"
android:startColor="@color/mastodonC1__"
android:type="linear" />
</shape>

View File

@ -108,8 +108,8 @@
<ImageButton
android:id="@+id/toot_picture"
android:padding="5dp"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@drawable/ic_action_camera"
tools:ignore="ContentDescription" />
<ImageButton
@ -117,8 +117,8 @@
android:layout_marginStart="5dp"
android:id="@+id/toot_visibility"
android:padding="5dp"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@drawable/ic_action_globe"
tools:ignore="ContentDescription" />
<Button
@ -126,8 +126,8 @@
android:padding="5dp"
android:text="@string/cw"
style="@style/Base.Widget.AppCompat.Button.Borderless.Colored"
android:layout_width="40dp"
android:layout_height="40dp" />
android:layout_width="50dp"
android:layout_height="50dp" />
<TextView
android:id="@+id/toot_space_left"
android:layout_width="0dp"
@ -135,7 +135,7 @@
android:layout_weight="1"
android:gravity="center"
android:layout_gravity="center"
android:layout_height="40dp" />
android:layout_height="50dp" />
<Button
android:id="@+id/toot_it"
android:padding="5dp"

View File

@ -39,17 +39,19 @@
<color name="black">#000</color>
<!-- Mastodon color scheme -->
<color name="mastodonC1__">#585c67</color>
<color name="mastodonC1">#282c37</color>
<color name="mastodonC1_">#313543</color>
<color name="mastodonC2">#9baec8</color>
<color name="mastodonC3">#d9e1e8</color>
<color name="mastodonC3_">#ebf3fa</color>
<color name="mastodonC3__">#efefef</color>
<color name="mastodonC4__">#772b90d9</color>
<color name="mastodonC4">#2b90d9</color>
<color name="mastodonC4_">#1b80c9</color>
<color name="foreground_material_dark" >@color/mastodonC3</color>
<color name="foreground_material_dark" >@color/mastodonC3__</color>
<color name="foreground_material_light">@color/mastodonC1</color>
<color name="background_material_dark">@color/mastodonC1</color>
@ -74,22 +76,22 @@
<color name="button_material_light">@color/mastodonC4</color>
<color name="switch_thumb_normal_material_dark">@color/mastodonC2</color>
<color name="switch_thumb_normal_material_light">@color/mastodonC3</color>
<color name="switch_thumb_normal_material_light">@color/mastodonC3__</color>
<color name="switch_thumb_disabled_material_dark">@color/mastodonC1</color>
<color name="switch_thumb_disabled_material_light">@color/mastodonC2</color>
<color name="switch_thumb_disabled_material_light">@color/mastodonC3__</color>
<color name="bright_foreground_material_dark">@color/mastodonC3</color>
<color name="bright_foreground_material_light">@color/mastodonC1</color>
<color name="bright_foreground_material_light">@color/mastodonC3</color>
<!-- White 50% -->
<color name="bright_foreground_disabled_material_dark">@color/mastodonC3</color>
<!-- Black 50% -->
<color name="bright_foreground_disabled_material_light">@color/mastodonC1</color>
<color name="bright_foreground_disabled_material_light">@color/mastodonC3</color>
<color name="bright_foreground_inverse_material_dark">@color/mastodonC2</color>
<color name="dim_foreground_material_dark">@color/mastodonC2</color>
<color name="dim_foreground_material_light">@color/mastodonC1</color>
<color name="dim_foreground_material_light">@color/mastodonC2</color>
<color name="dim_foreground_disabled_material_dark">@color/mastodonC3</color>
<color name="dim_foreground_disabled_material_light">@color/mastodonC2</color>
<color name="dim_foreground_disabled_material_light">@color/mastodonC3__</color>
<item name="hint_alpha_material_dark" format="float" type="dimen">0.50</item>
<item name="hint_alpha_material_light" format="float" type="dimen">0.38</item>
@ -108,7 +110,7 @@
<!-- 87% black -->
<color name="primary_text_default_material_light">@color/mastodonC1</color>
<!-- 54% black -->
<color name="secondary_text_default_material_light">@color/mastodonC2</color>
<color name="secondary_text_default_material_light">@color/mastodonC3__</color>
<!-- 100% white -->
<color name="primary_text_default_material_dark">@color/mastodonC3</color>
@ -123,8 +125,8 @@
<item name="highlight_alpha_material_colored" format="float" type="dimen">0.26</item>
<!-- 26% of default values -->
<color name="primary_text_disabled_material_light">@color/mastodonC3</color>
<color name="secondary_text_disabled_material_light">@color/mastodonC3</color>
<color name="primary_text_disabled_material_light">@color/mastodonC3__</color>
<color name="secondary_text_disabled_material_light">@color/mastodonC3__</color>
<!-- 30% of default values -->
<color name="primary_text_disabled_material_dark">@color/mastodonC3</color>

View File

@ -13,7 +13,7 @@
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/mastodonC1</item>
<item name="colorPrimaryDark">@color/mastodonC2</item>
<item name="colorPrimaryDark">@color/mastodonC3__</item>
<item name="colorAccent">@color/mastodonC4</item>
<item name="android:buttonStyle">@style/ButtonColor</item>
<item name="cardStyle">@style/CardViewStyle.Light</item>
@ -29,12 +29,12 @@
<item name="android:itemBackground">@drawable/menu_selector</item>
<item name="android:actionModeStyle">@style/ActionMode</item>
<item name="android:dropDownListViewStyle">@style/DropDownListViewStyle</item>
<item name="actionBarTextColor">@color/mastodonC3</item>
<item name="actionBarTextColor">@color/mastodonC3__</item>
</style>
<style name="AppTheme_NoActionBar" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/mastodonC2</item>
<item name="colorPrimaryDark">@color/mastodonC2</item>
<item name="colorPrimary">@color/mastodonC1</item>
<item name="colorPrimaryDark">@color/mastodonC3__</item>
<item name="colorAccent">@color/mastodonC4</item>
<item name="android:buttonStyle">@style/ButtonColor</item>
<item name="cardStyle">@style/CardViewStyle.Light</item>
@ -51,40 +51,42 @@
<item name="android:itemBackground">@drawable/menu_selector</item>
<item name="android:actionModeStyle">@style/ActionMode</item>
<item name="android:dropDownListViewStyle">@style/DropDownListViewStyle</item>
<item name="actionBarTextColor">@color/mastodonC3</item>
<item name="actionBarTextColor">@color/mastodonC3__</item>
<item name="colorButtonNormal">@color/mastodonC4</item>
</style>
<style name="DropDownListViewStyle" parent="Base.Widget.AppCompat.ListView.DropDown">
<item name="android:background">@color/mastodonC2</item>
<item name="android:background">@color/mastodonC3__</item>
</style>
<style name="ActionMode" parent="Base.Widget.AppCompat.ActionMode">
<item name="android:background">@drawable/menu_selector</item>
</style>
<style name="ButtonColor" parent="Base.Widget.AppCompat.Button">
<item name="android:textColor">@color/white</item>
<item name="android:background">@drawable/button_selector</item>
</style>
<style name="PopupMenu" parent="@android:style/Widget.PopupMenu">
<item name="android:windowBackground">@color/mastodonC1</item>
</style>
<style name="Dialog" parent="Theme.AppCompat.Light.Dialog.Alert">
<item name="android:windowBackground">@color/mastodonC2</item>
<item name="android:windowBackground">@color/mastodonC3__</item>
<item name="colorAccent">@color/mastodonC4</item>
<item name="android:headerBackground">@color/mastodonC2</item>
<item name="colorControlNormal">@color/mastodonC2</item>
<item name="android:headerBackground">@color/mastodonC3__</item>
<item name="colorControlNormal">@color/mastodonC3__</item>
</style>
<style name="SpinnerStyle" parent="Base.Widget.AppCompat.Spinner">
<item name="android:popupBackground">@color/mastodonC2</item>
<item name="android:windowBackground">@color/mastodonC2</item>
<item name="android:colorBackground">@color/mastodonC2</item>
<item name="android:popupBackground">@color/mastodonC3__</item>
<item name="android:windowBackground">@color/mastodonC3__</item>
<item name="android:colorBackground">@color/mastodonC3__</item>
</style>
<style name="SpinnerItemStyle" parent="Base.Widget.AppCompat.TextView.SpinnerItem">
<item name="android:padding">10dp</item>
</style>
<style name="AlertDialog" parent="Theme.AppCompat.Light.Dialog.Alert">
<item name="android:windowBackground">@color/mastodonC2</item>
<item name="android:windowBackground">@color/mastodonC3__</item>
</style>
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light">
<item name="android:windowBackground">@color/mastodonC2</item>
<item name="android:windowBackground">@color/mastodonC3__</item>
</style>
<style name="Image.Border.Light" parent="AppTheme">
@ -156,6 +158,7 @@
<style name="DarkButtonColor" parent="Base.Widget.AppCompat.Button">
<item name="android:textColor">@color/white</item>
<item name="android:background">@drawable/button_selector</item>
</style>
<style name="DialogDark" parent="Theme.AppCompat.Dialog">