added custom menu group icon
This commit is contained in:
parent
f20b92d74b
commit
4462fec2a9
@ -150,6 +150,7 @@ public class ListDetail extends AppCompatActivity implements OnTabSelectedListen
|
|||||||
public boolean onCreateOptionsMenu(Menu m) {
|
public boolean onCreateOptionsMenu(Menu m) {
|
||||||
getMenuInflater().inflate(R.menu.userlist, m);
|
getMenuInflater().inflate(R.menu.userlist, m);
|
||||||
AppStyles.setMenuIconColor(m, settings.getIconColor());
|
AppStyles.setMenuIconColor(m, settings.getIconColor());
|
||||||
|
AppStyles.setOverflowIcon(toolbar, settings.getIconColor());
|
||||||
return super.onCreateOptionsMenu(m);
|
return super.onCreateOptionsMenu(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,6 +101,7 @@ public class TweetActivity extends AppCompatActivity implements OnClickListener,
|
|||||||
private TextView tweet_api, tweetDate, tweetText, scrName, usrName, tweetLocName, sensitive_media;
|
private TextView tweet_api, tweetDate, tweetText, scrName, usrName, tweetLocName, sensitive_media;
|
||||||
private Button ansButton, rtwButton, favButton, replyName, tweetLocGPS, retweeter;
|
private Button ansButton, rtwButton, favButton, replyName, tweetLocGPS, retweeter;
|
||||||
private ImageView profile_img, mediaButton;
|
private ImageView profile_img, mediaButton;
|
||||||
|
private Toolbar toolbar;
|
||||||
private Dialog deleteDialog;
|
private Dialog deleteDialog;
|
||||||
|
|
||||||
private GlobalSettings settings;
|
private GlobalSettings settings;
|
||||||
@ -114,9 +115,9 @@ public class TweetActivity extends AppCompatActivity implements OnClickListener,
|
|||||||
protected void onCreate(@Nullable Bundle b) {
|
protected void onCreate(@Nullable Bundle b) {
|
||||||
super.onCreate(b);
|
super.onCreate(b);
|
||||||
setContentView(R.layout.page_tweet);
|
setContentView(R.layout.page_tweet);
|
||||||
Toolbar tool = findViewById(R.id.tweet_toolbar);
|
|
||||||
View root = findViewById(R.id.tweet_layout);
|
View root = findViewById(R.id.tweet_layout);
|
||||||
ViewPager pager = findViewById(R.id.tweet_pager);
|
ViewPager pager = findViewById(R.id.tweet_pager);
|
||||||
|
toolbar = findViewById(R.id.tweet_toolbar);
|
||||||
ansButton = findViewById(R.id.tweet_answer);
|
ansButton = findViewById(R.id.tweet_answer);
|
||||||
rtwButton = findViewById(R.id.tweet_retweet);
|
rtwButton = findViewById(R.id.tweet_retweet);
|
||||||
favButton = findViewById(R.id.tweet_favorit);
|
favButton = findViewById(R.id.tweet_favorit);
|
||||||
@ -166,8 +167,8 @@ public class TweetActivity extends AppCompatActivity implements OnClickListener,
|
|||||||
tweetText.setMovementMethod(LinkAndScrollMovement.getInstance());
|
tweetText.setMovementMethod(LinkAndScrollMovement.getInstance());
|
||||||
tweetText.setLinkTextColor(settings.getHighlightColor());
|
tweetText.setLinkTextColor(settings.getHighlightColor());
|
||||||
deleteDialog = DialogBuilder.create(this, DELETE_TWEET, this);
|
deleteDialog = DialogBuilder.create(this, DELETE_TWEET, this);
|
||||||
tool.setTitle("");
|
toolbar.setTitle("");
|
||||||
setSupportActionBar(tool);
|
setSupportActionBar(toolbar);
|
||||||
AppStyles.setTheme(settings, root);
|
AppStyles.setTheme(settings, root);
|
||||||
|
|
||||||
retweeter.setOnClickListener(this);
|
retweeter.setOnClickListener(this);
|
||||||
@ -222,6 +223,7 @@ public class TweetActivity extends AppCompatActivity implements OnClickListener,
|
|||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu m) {
|
public boolean onCreateOptionsMenu(Menu m) {
|
||||||
getMenuInflater().inflate(R.menu.tweet, m);
|
getMenuInflater().inflate(R.menu.tweet, m);
|
||||||
|
AppStyles.setOverflowIcon(toolbar, settings.getIconColor());
|
||||||
return super.onCreateOptionsMenu(m);
|
return super.onCreateOptionsMenu(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,6 +142,7 @@ public class UserProfile extends AppCompatActivity implements OnClickListener, O
|
|||||||
private Button following, follower;
|
private Button following, follower;
|
||||||
private ViewPager tabPages;
|
private ViewPager tabPages;
|
||||||
private TabLayout tabLayout;
|
private TabLayout tabLayout;
|
||||||
|
private Toolbar toolbar;
|
||||||
private Dialog unfollowConfirm, blockConfirm, muteConfirm;
|
private Dialog unfollowConfirm, blockConfirm, muteConfirm;
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@ -154,7 +155,7 @@ public class UserProfile extends AppCompatActivity implements OnClickListener, O
|
|||||||
protected void onCreate(@Nullable Bundle b) {
|
protected void onCreate(@Nullable Bundle b) {
|
||||||
super.onCreate(b);
|
super.onCreate(b);
|
||||||
setContentView(R.layout.page_profile);
|
setContentView(R.layout.page_profile);
|
||||||
Toolbar tool = findViewById(R.id.profile_toolbar);
|
toolbar = findViewById(R.id.profile_toolbar);
|
||||||
View root = findViewById(R.id.user_view);
|
View root = findViewById(R.id.user_view);
|
||||||
tabLayout = findViewById(R.id.profile_tab);
|
tabLayout = findViewById(R.id.profile_tab);
|
||||||
user_bio = findViewById(R.id.bio);
|
user_bio = findViewById(R.id.bio);
|
||||||
@ -178,7 +179,7 @@ public class UserProfile extends AppCompatActivity implements OnClickListener, O
|
|||||||
user_location.setCompoundDrawablesWithIntrinsicBounds(R.drawable.userlocation, 0, 0, 0);
|
user_location.setCompoundDrawablesWithIntrinsicBounds(R.drawable.userlocation, 0, 0, 0);
|
||||||
user_website.setCompoundDrawablesWithIntrinsicBounds(R.drawable.link, 0, 0, 0);
|
user_website.setCompoundDrawablesWithIntrinsicBounds(R.drawable.link, 0, 0, 0);
|
||||||
follow_back.setCompoundDrawablesWithIntrinsicBounds(R.drawable.followback, 0, 0, 0);
|
follow_back.setCompoundDrawablesWithIntrinsicBounds(R.drawable.followback, 0, 0, 0);
|
||||||
tool.setBackgroundColor(settings.getBackgroundColor() & TOOLBAR_TRANSPARENCY);
|
toolbar.setBackgroundColor(settings.getBackgroundColor() & TOOLBAR_TRANSPARENCY);
|
||||||
username.setBackgroundColor(settings.getBackgroundColor() & TEXT_TRANSPARENCY);
|
username.setBackgroundColor(settings.getBackgroundColor() & TEXT_TRANSPARENCY);
|
||||||
follow_back.setBackgroundColor(settings.getBackgroundColor() & TEXT_TRANSPARENCY);
|
follow_back.setBackgroundColor(settings.getBackgroundColor() & TEXT_TRANSPARENCY);
|
||||||
user_bio.setMovementMethod(LinkAndScrollMovement.getInstance());
|
user_bio.setMovementMethod(LinkAndScrollMovement.getInstance());
|
||||||
@ -186,8 +187,8 @@ public class UserProfile extends AppCompatActivity implements OnClickListener, O
|
|||||||
AppStyles.setTheme(settings, root);
|
AppStyles.setTheme(settings, root);
|
||||||
user_website.setTextColor(settings.getHighlightColor());
|
user_website.setTextColor(settings.getHighlightColor());
|
||||||
|
|
||||||
tool.setTitle("");
|
toolbar.setTitle("");
|
||||||
setSupportActionBar(tool);
|
setSupportActionBar(toolbar);
|
||||||
adapter = new FragmentAdapter(getSupportFragmentManager());
|
adapter = new FragmentAdapter(getSupportFragmentManager());
|
||||||
tabPages.setAdapter(adapter);
|
tabPages.setAdapter(adapter);
|
||||||
tabPages.setOffscreenPageLimit(2);
|
tabPages.setOffscreenPageLimit(2);
|
||||||
@ -262,6 +263,7 @@ public class UserProfile extends AppCompatActivity implements OnClickListener, O
|
|||||||
public boolean onCreateOptionsMenu(Menu m) {
|
public boolean onCreateOptionsMenu(Menu m) {
|
||||||
getMenuInflater().inflate(R.menu.profile, m);
|
getMenuInflater().inflate(R.menu.profile, m);
|
||||||
AppStyles.setMenuIconColor(m, settings.getIconColor());
|
AppStyles.setMenuIconColor(m, settings.getIconColor());
|
||||||
|
AppStyles.setOverflowIcon(toolbar, settings.getIconColor());
|
||||||
return super.onCreateOptionsMenu(m);
|
return super.onCreateOptionsMenu(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +24,9 @@ import android.widget.TextView;
|
|||||||
import androidx.annotation.ArrayRes;
|
import androidx.annotation.ArrayRes;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.content.res.AppCompatResources;
|
import androidx.appcompat.content.res.AppCompatResources;
|
||||||
|
import androidx.appcompat.widget.Toolbar;
|
||||||
import androidx.cardview.widget.CardView;
|
import androidx.cardview.widget.CardView;
|
||||||
|
import androidx.core.content.res.ResourcesCompat;
|
||||||
import androidx.viewpager.widget.ViewPager;
|
import androidx.viewpager.widget.ViewPager;
|
||||||
|
|
||||||
import com.google.android.material.tabs.TabLayout;
|
import com.google.android.material.tabs.TabLayout;
|
||||||
@ -214,7 +216,24 @@ public final class AppStyles {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* set Toolbar overflow icon color
|
||||||
|
*
|
||||||
|
* @param toolbar Toolbar with overflow icon
|
||||||
|
* @param color icon color
|
||||||
|
*/
|
||||||
|
public static void setOverflowIcon(Toolbar toolbar, int color) {
|
||||||
|
Drawable groupIcon = ResourcesCompat.getDrawable(toolbar.getResources(), R.drawable.group, null);
|
||||||
|
setDrawableColor(groupIcon, color);
|
||||||
|
toolbar.setOverflowIcon(groupIcon);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* sets progress circle color
|
||||||
|
*
|
||||||
|
* @param circle progress circle
|
||||||
|
* @param color highlight color
|
||||||
|
*/
|
||||||
public static void setProgressColor(ProgressBar circle, int color) {
|
public static void setProgressColor(ProgressBar circle, int color) {
|
||||||
Drawable icon = circle.getIndeterminateDrawable();
|
Drawable icon = circle.getIndeterminateDrawable();
|
||||||
if (icon != null) {
|
if (icon != null) {
|
||||||
|
9
app/src/main/res/drawable/group.xml
Normal file
9
app/src/main/res/drawable/group.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="20dp"
|
||||||
|
android:height="20dp"
|
||||||
|
android:viewportWidth="20"
|
||||||
|
android:viewportHeight="20">
|
||||||
|
<path
|
||||||
|
android:pathData="M10.001,7.8C8.786,7.8 7.8,8.785 7.8,10s0.986,2.2 2.201,2.2S12.2,11.215 12.2,10S11.216,7.8 10.001,7.8zM10.001,5.2C11.216,5.2 12.2,4.214 12.2,3s-0.984,-2.2 -2.199,-2.2S7.8,1.785 7.8,3S8.786,5.2 10.001,5.2zM10.001,14.8C8.786,14.8 7.8,15.785 7.8,17s0.986,2.2 2.201,2.2S12.2,18.215 12.2,17S11.216,14.8 10.001,14.8z"
|
||||||
|
android:fillColor="#FFFFFF" />
|
||||||
|
</vector>
|
Loading…
x
Reference in New Issue
Block a user