Some changes with colors

This commit is contained in:
tom79 2019-07-02 18:13:27 +02:00
parent acaf0f5bcb
commit b2b8d5deb5
15 changed files with 65 additions and 51 deletions

View File

@ -164,21 +164,21 @@ public class SettingsActivity extends BaseActivity implements ViewAnimator.ViewA
private void createMenuList() {
SlideMenuItem menuItem0 = new SlideMenuItem(ContentSettingsFragment.CLOSE, R.drawable.ic_close);
SlideMenuItem menuItem0 = new SlideMenuItem(ContentSettingsFragment.type.CLOSE, R.drawable.ic_close);
list.add(menuItem0);
SlideMenuItem menuItem1 = new SlideMenuItem(ContentSettingsFragment.TIMELINES, R.drawable.ic_timeline_menu_s);
SlideMenuItem menuItem1 = new SlideMenuItem(ContentSettingsFragment.type.TIMELINES, R.drawable.ic_timeline_menu_s);
list.add(menuItem1);
SlideMenuItem menuItem2 = new SlideMenuItem(ContentSettingsFragment.ADMIN, R.drawable.ic_security_admin_menu);
SlideMenuItem menuItem2 = new SlideMenuItem(ContentSettingsFragment.type.ADMIN, R.drawable.ic_security_admin_menu);
list.add(menuItem2);
SlideMenuItem menuItem3 = new SlideMenuItem(ContentSettingsFragment.NOTIFICATIONS, R.drawable.ic_notifications_menu);
SlideMenuItem menuItem3 = new SlideMenuItem(ContentSettingsFragment.type.NOTIFICATIONS, R.drawable.ic_notifications_menu);
list.add(menuItem3);
SlideMenuItem menuItem4 = new SlideMenuItem(ContentSettingsFragment.INTERFACE, R.drawable.ic_tablet_menu);
SlideMenuItem menuItem4 = new SlideMenuItem(ContentSettingsFragment.type.INTERFACE, R.drawable.ic_tablet_menu);
list.add(menuItem4);
SlideMenuItem menuItem5 = new SlideMenuItem(ContentSettingsFragment.COMPOSE, R.drawable.ic_edit_black_menu);
SlideMenuItem menuItem5 = new SlideMenuItem(ContentSettingsFragment.type.COMPOSE, R.drawable.ic_edit_black_menu);
list.add(menuItem5);
SlideMenuItem menuItem6 = new SlideMenuItem(ContentSettingsFragment.HIDDEN, R.drawable.ic_visibility_off_menu);
SlideMenuItem menuItem6 = new SlideMenuItem(ContentSettingsFragment.type.HIDDEN, R.drawable.ic_visibility_off_menu);
list.add(menuItem6);
SlideMenuItem menuItem7 = new SlideMenuItem(ContentSettingsFragment.TODO, R.drawable.ic_all_inclusive_menu);
SlideMenuItem menuItem7 = new SlideMenuItem(ContentSettingsFragment.type.ALL, R.drawable.ic_all_inclusive_menu);
list.add(menuItem7);
}
@ -217,7 +217,7 @@ public class SettingsActivity extends BaseActivity implements ViewAnimator.ViewA
}
private ScreenShotable replaceFragment(ScreenShotable screenShotable, String type, int topPosition) {
private ScreenShotable replaceFragment(ScreenShotable screenShotable, ContentSettingsFragment.type type, int topPosition) {
this.res = this.res == R.drawable.ic_timeline_menu_s ? R.drawable.ic_notifications_menu : R.drawable.ic_timeline_menu_s;
View view = findViewById(R.id.content_frame);
int finalRadius = Math.max(view.getWidth(), view.getHeight());
@ -234,7 +234,7 @@ public class SettingsActivity extends BaseActivity implements ViewAnimator.ViewA
ContentSettingsFragment contentSettingsFragment = ContentSettingsFragment.newInstance(this.res);
Bundle bundle = new Bundle();
bundle.putString("type",type);
bundle.putSerializable("type",type);
contentSettingsFragment.setArguments(bundle);
getSupportFragmentManager().beginTransaction().replace(R.id.content_frame, contentSettingsFragment).commit();
return contentSettingsFragment;
@ -244,8 +244,8 @@ public class SettingsActivity extends BaseActivity implements ViewAnimator.ViewA
@Override
public ScreenShotable onSwitch(Resourceble slideMenuItem, ScreenShotable screenShotable, int position) {
String type = slideMenuItem.getName();
if (ContentSettingsFragment.CLOSE.equals(type)) {
ContentSettingsFragment.type type = slideMenuItem.getType();
if (ContentSettingsFragment.type.CLOSE.equals(type)) {
finish();
return null;
}

View File

@ -1,10 +1,12 @@
package app.fedilab.android.animatemenu.interfaces;
import app.fedilab.android.fragments.ContentSettingsFragment;
/**
* Created by Konstantin on 12.01.2015.
*/
public interface Resourceble {
public int getImageRes();
public String getName();
public ContentSettingsFragment.type getType();
}

View File

@ -2,31 +2,31 @@ package app.fedilab.android.animatemenu.model;
import app.fedilab.android.animatemenu.interfaces.Resourceble;
import app.fedilab.android.fragments.ContentSettingsFragment;
/**
* Created by Konstantin on 23.12.2014.
*/
public class SlideMenuItem implements Resourceble {
private String name;
private ContentSettingsFragment.type type;
private int imageRes;
public SlideMenuItem(String name, int imageRes) {
this.name = name;
public SlideMenuItem(ContentSettingsFragment.type type, int imageRes) {
this.type = type;
this.imageRes = imageRes;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getImageRes() {
return imageRes;
}
@Override
public ContentSettingsFragment.type getType() {
return this.type;
}
public void setImageRes(int imageRes) {
this.imageRes = imageRes;
}

View File

@ -37,6 +37,13 @@ import app.fedilab.android.animatemenu.interfaces.ScreenShotable;
import app.fedilab.android.helper.Helper;
import static android.content.Context.MODE_PRIVATE;
import static app.fedilab.android.fragments.ContentSettingsFragment.type.ADMIN;
import static app.fedilab.android.fragments.ContentSettingsFragment.type.ALL;
import static app.fedilab.android.fragments.ContentSettingsFragment.type.COMPOSE;
import static app.fedilab.android.fragments.ContentSettingsFragment.type.HIDDEN;
import static app.fedilab.android.fragments.ContentSettingsFragment.type.INTERFACE;
import static app.fedilab.android.fragments.ContentSettingsFragment.type.NOTIFICATIONS;
import static app.fedilab.android.fragments.ContentSettingsFragment.type.TIMELINES;
public class ContentSettingsFragment extends Fragment implements ScreenShotable {
@ -44,16 +51,20 @@ public class ContentSettingsFragment extends Fragment implements ScreenShotable
private View containerView;
protected int res;
private Bitmap bitmap;
private String type;
private type type;
private Context context;
public static final String CLOSE = "Close";
public static final String TIMELINES = "Timelines";
public static final String ADMIN = "Admin";
public static final String NOTIFICATIONS = "Notifications";
public static final String INTERFACE = "Interface";
public static final String COMPOSE = "Compose";
public static final String HIDDEN = "Hidden";
public static final String TODO = "All";
public enum type{
CLOSE,
TIMELINES,
ADMIN,
NOTIFICATIONS,
INTERFACE,
COMPOSE,
HIDDEN,
ALL
}
public static ContentSettingsFragment newInstance(int resId) {
ContentSettingsFragment contentFragment = new ContentSettingsFragment();
@ -86,7 +97,7 @@ public class ContentSettingsFragment extends Fragment implements ScreenShotable
Bundle bundle = this.getArguments();
if (bundle != null) {
type = bundle.getString("type", null);
type = (type)bundle.getSerializable("type");
}
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
@ -114,17 +125,17 @@ public class ContentSettingsFragment extends Fragment implements ScreenShotable
if(type == null || type.equals(TIMELINES)){
settings_timeline.setVisibility(View.VISIBLE);
}else if( type.equals(NOTIFICATIONS)){
}else if( type == NOTIFICATIONS){
settings_notifications.setVisibility(View.VISIBLE);
}else if( type.equals(ADMIN)){
}else if( type == ADMIN){
settings_admin.setVisibility(View.VISIBLE);
}else if(type.equals(INTERFACE)){
}else if(type == INTERFACE){
settings_interface.setVisibility(View.VISIBLE);
}else if(type.equals(COMPOSE)){
}else if(type == COMPOSE){
settings_compose.setVisibility(View.VISIBLE);
}else if( type.equals(HIDDEN)){
}else if( type == HIDDEN){
settings_hidden.setVisibility(View.VISIBLE);
}else if( type.equals(TODO)){
}else if( type == ALL){
settings_to_do.setVisibility(View.VISIBLE);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 291 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 291 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 370 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 370 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 577 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 577 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 799 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 798 B

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/item_down"/>
<item android:state_selected="true" android:drawable="@drawable/item_down"/>
<item android:state_focused="true" android:drawable="@drawable/item_down"/>
<item android:drawable="@drawable/item_up"/>
<item android:state_pressed="true" android:drawable="@color/mastodonC2"/>
<item android:state_selected="true" android:drawable="@color/mastodonC2"/>
<item android:state_focused="true" android:drawable="@color/mastodonC2"/>
<item android:drawable="@color/mastodonC1"/>
</selector>

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">

View File

@ -1,10 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/menu_item_container"
android:layout_width="80dp"
android:layout_height="80dp"
android:clickable="true"
android:background="@drawable/menu_item_selector">
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/menu_item_container"
android:layout_width="80dp"
android:layout_height="80dp"
android:minHeight="80dp"
android:clickable="true"
android:background="@drawable/menu_item_selector"
android:focusable="true">
<ImageView
android:id="@+id/menu_item_image"
@ -12,5 +15,4 @@
android:layout_height="wrap_content"
android:layout_centerInParent="true"/>
</RelativeLayout>