Dedicates icons when writing toots

This commit is contained in:
stom79 2017-10-29 07:15:13 +01:00
parent e04b997ffb
commit c5b9074e33
46 changed files with 67 additions and 45 deletions

View File

@ -986,7 +986,7 @@ public abstract class BaseMainActivity extends AppCompatActivity
changeDrawableColor(getApplicationContext(), R.drawable.ic_lock_open,R.color.dark_icon);
changeDrawableColor(getApplicationContext(), R.drawable.ic_lock_outline,R.color.dark_icon);
changeDrawableColor(getApplicationContext(), R.drawable.ic_mail_outline,R.color.dark_icon);
changeDrawableColor(getApplicationContext(), R.drawable.ic_retweet,R.color.dark_icon);
changeDrawableColor(getApplicationContext(), R.drawable.ic_repeat,R.color.dark_icon);
changeDrawableColor(getApplicationContext(), R.drawable.ic_star_border,R.color.dark_icon);
changeDrawableColor(getApplicationContext(), R.drawable.ic_photo,R.color.dark_text);
changeDrawableColor(getApplicationContext(), R.drawable.ic_remove_red_eye,R.color.dark_text);
@ -998,7 +998,7 @@ public abstract class BaseMainActivity extends AppCompatActivity
changeDrawableColor(getApplicationContext(), R.drawable.ic_lock_open,R.color.black);
changeDrawableColor(getApplicationContext(), R.drawable.ic_lock_outline,R.color.black);
changeDrawableColor(getApplicationContext(), R.drawable.ic_mail_outline,R.color.black);
changeDrawableColor(getApplicationContext(), R.drawable.ic_retweet,R.color.black);
changeDrawableColor(getApplicationContext(), R.drawable.ic_repeat,R.color.black);
changeDrawableColor(getApplicationContext(), R.drawable.ic_star_border,R.color.black);
changeDrawableColor(getApplicationContext(), R.drawable.ic_photo,R.color.white);
changeDrawableColor(getApplicationContext(), R.drawable.ic_remove_red_eye,R.color.white);

View File

@ -443,16 +443,16 @@ public class TootActivity extends AppCompatActivity implements OnRetrieveSearcAc
visibility = sharedpreferences.getString(Helper.SET_TOOT_VISIBILITY + "@" + account.getAcct() + "@" + account.getInstance(), "public");
switch (visibility) {
case "public":
toot_visibility.setImageResource(R.drawable.ic_public);
toot_visibility.setImageResource(R.drawable.ic_public_toot);
break;
case "unlisted":
toot_visibility.setImageResource(R.drawable.ic_lock_open);
toot_visibility.setImageResource(R.drawable.ic_lock_open_toot);
break;
case "private":
toot_visibility.setImageResource(R.drawable.ic_lock_outline);
toot_visibility.setImageResource(R.drawable.ic_lock_outline_toot);
break;
case "direct":
toot_visibility.setImageResource(R.drawable.ic_mail_outline);
toot_visibility.setImageResource(R.drawable.ic_mail_outline_toot);
break;
}
}
@ -1158,19 +1158,19 @@ public class TootActivity extends AppCompatActivity implements OnRetrieveSearcAc
switch (position){
case 0:
visibility = "public";
toot_visibility.setImageResource(R.drawable.ic_public);
toot_visibility.setImageResource(R.drawable.ic_public_toot);
break;
case 1:
visibility = "unlisted";
toot_visibility.setImageResource(R.drawable.ic_lock_open);
toot_visibility.setImageResource(R.drawable.ic_lock_open_toot);
break;
case 2:
visibility = "private";
toot_visibility.setImageResource(R.drawable.ic_lock_outline);
toot_visibility.setImageResource(R.drawable.ic_lock_outline_toot);
break;
case 3:
visibility = "direct";
toot_visibility.setImageResource(R.drawable.ic_mail_outline);
toot_visibility.setImageResource(R.drawable.ic_mail_outline_toot);
break;
}
@ -1426,19 +1426,19 @@ public class TootActivity extends AppCompatActivity implements OnRetrieveSearcAc
switch (status.getVisibility()){
case "public":
visibility = "public";
toot_visibility.setImageResource(R.drawable.ic_public);
toot_visibility.setImageResource(R.drawable.ic_public_toot);
break;
case "unlisted":
visibility = "unlisted";
toot_visibility.setImageResource(R.drawable.ic_lock_open);
toot_visibility.setImageResource(R.drawable.ic_lock_open_toot);
break;
case "private":
visibility = "private";
toot_visibility.setImageResource(R.drawable.ic_lock_outline);
toot_visibility.setImageResource(R.drawable.ic_lock_outline_toot);
break;
case "direct":
visibility = "direct";
toot_visibility.setImageResource(R.drawable.ic_mail_outline);
toot_visibility.setImageResource(R.drawable.ic_mail_outline_toot);
break;
}
@ -1475,19 +1475,19 @@ public class TootActivity extends AppCompatActivity implements OnRetrieveSearcAc
switch (tootReply.getVisibility()){
case "public":
visibility = "public";
toot_visibility.setImageResource(R.drawable.ic_public);
toot_visibility.setImageResource(R.drawable.ic_public_toot);
break;
case "unlisted":
visibility = "unlisted";
toot_visibility.setImageResource(R.drawable.ic_lock_open);
toot_visibility.setImageResource(R.drawable.ic_lock_open_toot);
break;
case "private":
visibility = "private";
toot_visibility.setImageResource(R.drawable.ic_lock_outline);
toot_visibility.setImageResource(R.drawable.ic_lock_outline_toot);
break;
case "direct":
visibility = "direct";
toot_visibility.setImageResource(R.drawable.ic_mail_outline);
toot_visibility.setImageResource(R.drawable.ic_mail_outline_toot);
break;
}
//If toot is not restored
@ -1562,19 +1562,19 @@ public class TootActivity extends AppCompatActivity implements OnRetrieveSearcAc
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_public, R.color.dark_text);
changeDrawableColor(TootActivity.this, R.drawable.ic_lock_open, R.color.dark_text);
changeDrawableColor(TootActivity.this, R.drawable.ic_lock_outline, R.color.dark_text);
changeDrawableColor(TootActivity.this, R.drawable.ic_mail_outline, R.color.dark_text);
changeDrawableColor(TootActivity.this, R.drawable.ic_public_toot, R.color.dark_text);
changeDrawableColor(TootActivity.this, R.drawable.ic_lock_open_toot, R.color.dark_text);
changeDrawableColor(TootActivity.this, R.drawable.ic_lock_outline_toot, R.color.dark_text);
changeDrawableColor(TootActivity.this, R.drawable.ic_mail_outline_toot, R.color.dark_text);
changeDrawableColor(TootActivity.this, R.drawable.ic_insert_photo, 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_public, R.color.white);
changeDrawableColor(TootActivity.this, R.drawable.ic_lock_open, R.color.white);
changeDrawableColor(TootActivity.this, R.drawable.ic_lock_outline, R.color.white);
changeDrawableColor(TootActivity.this, R.drawable.ic_mail_outline, R.color.white);
changeDrawableColor(TootActivity.this, R.drawable.ic_public_toot, R.color.white);
changeDrawableColor(TootActivity.this, R.drawable.ic_lock_open_toot, R.color.white);
changeDrawableColor(TootActivity.this, R.drawable.ic_lock_outline_toot, R.color.white);
changeDrawableColor(TootActivity.this, R.drawable.ic_mail_outline_toot, R.color.white);
changeDrawableColor(TootActivity.this, R.drawable.ic_insert_photo, 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);

View File

@ -221,7 +221,7 @@ public class NotificationsListAdapter extends RecyclerView.Adapter implements On
changeDrawableColor(context, R.drawable.ic_lock_open,R.color.dark_icon);
changeDrawableColor(context, R.drawable.ic_lock_outline,R.color.dark_icon);
changeDrawableColor(context, R.drawable.ic_mail_outline,R.color.dark_icon);
changeDrawableColor(context, R.drawable.ic_retweet,R.color.dark_icon);
changeDrawableColor(context, R.drawable.ic_repeat,R.color.dark_icon);
changeDrawableColor(context, R.drawable.ic_star_border,R.color.dark_icon);
changeDrawableColor(context, R.drawable.ic_photo,R.color.dark_text);
changeDrawableColor(context, R.drawable.ic_remove_red_eye,R.color.dark_text);
@ -233,7 +233,7 @@ public class NotificationsListAdapter extends RecyclerView.Adapter implements On
changeDrawableColor(context, R.drawable.ic_lock_open,R.color.black);
changeDrawableColor(context, R.drawable.ic_lock_outline,R.color.black);
changeDrawableColor(context, R.drawable.ic_mail_outline,R.color.black);
changeDrawableColor(context, R.drawable.ic_retweet,R.color.black);
changeDrawableColor(context, R.drawable.ic_repeat,R.color.black);
changeDrawableColor(context, R.drawable.ic_star_border,R.color.black);
changeDrawableColor(context, R.drawable.ic_photo,R.color.black);
changeDrawableColor(context, R.drawable.ic_remove_red_eye,R.color.black);

View File

@ -157,7 +157,7 @@ public class SearchListAdapter extends BaseAdapter {
img.setBounds(0,0,(int) (20 * scale + 0.5f),(int) (15 * scale + 0.5f));
holder.status_account_displayname.setCompoundDrawables( img, null, null, null);
}else if( status.getReblog() != null){
Drawable img = ContextCompat.getDrawable(context, R.drawable.ic_retweet);
Drawable img = ContextCompat.getDrawable(context, R.drawable.ic_repeat);
img.setBounds(0,0,(int) (20 * scale + 0.5f),(int) (15 * scale + 0.5f));
holder.status_account_displayname.setCompoundDrawables( img, null, null, null);
}else{

View File

@ -272,15 +272,6 @@ public class DisplayNotificationsFragment extends Fragment implements OnRetrieve
}
@Override
public void onResume(){
super.onResume();
int visibleItemCount = mLayoutManager.getChildCount();
int firstVisibleItem = mLayoutManager.findFirstVisibleItemPosition();
for(int i = firstVisibleItem ; i <= firstVisibleItem + visibleItemCount ; i++){
notificationsListAdapter.notifyItemChanged(i);
}
}
@Override
public void onRetrieveMissingNotifications(List<Notification> notifications) {

View File

@ -374,11 +374,6 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
retrieveMissingToots(statuses.get(0).getId());
}
}
int visibleItemCount = mLayoutManager.getChildCount();
int firstVisibleItem = mLayoutManager.findFirstVisibleItemPosition();
for(int i = firstVisibleItem ; i <= firstVisibleItem + visibleItemCount ; i++){
statusListAdapter.notifyItemChanged(i);
}
}
/**

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M12,17c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM18,8h-1L17,6c0,-2.76 -2.24,-5 -5,-5S7,3.24 7,6h1.9c0,-1.71 1.39,-3.1 3.1,-3.1 1.71,0 3.1,1.39 3.1,3.1v2L6,8c-1.1,0 -2,0.9 -2,2v10c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L20,10c0,-1.1 -0.9,-2 -2,-2zM18,20L6,20L6,10h12v10z"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M12,17c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM18,8h-1L17,6c0,-2.76 -2.24,-5 -5,-5S7,3.24 7,6v2L6,8c-1.1,0 -2,0.9 -2,2v10c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L20,10c0,-1.1 -0.9,-2 -2,-2zM8.9,6c0,-1.71 1.39,-3.1 3.1,-3.1s3.1,1.39 3.1,3.1v2L8.9,8L8.9,6zM18,20L6,20L6,10h12v10z"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M20,4L4,4c-1.1,0 -1.99,0.9 -1.99,2L2,18c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,6c0,-1.1 -0.9,-2 -2,-2zM20,18L4,18L4,8l8,5 8,-5v10zM12,11L4,6h16l-8,5z"/>
</vector>

View File

@ -4,6 +4,6 @@
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:fillColor="#FFFFFFFF"
android:pathData="M18,8c0,-3.31 -2.69,-6 -6,-6S6,4.69 6,8c0,4.5 6,11 6,11s6,-6.5 6,-11zM10,8c0,-1.1 0.9,-2 2,-2s2,0.9 2,2 -0.89,2 -2,2c-1.1,0 -2,-0.9 -2,-2zM5,20v2h14v-2L5,20z"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM11,19.93c-3.95,-0.49 -7,-3.85 -7,-7.93 0,-0.62 0.08,-1.21 0.21,-1.79L9,15v1c0,1.1 0.9,2 2,2v1.93zM17.9,17.39c-0.26,-0.81 -1,-1.39 -1.9,-1.39h-1v-3c0,-0.55 -0.45,-1 -1,-1L8,12v-2h2c0.55,0 1,-0.45 1,-1L11,7h2c1.1,0 2,-0.9 2,-2v-0.41c2.93,1.19 5,4.06 5,7.41 0,2.08 -0.8,3.97 -2.1,5.39z"/>
</vector>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 495 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 511 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 514 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 324 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 299 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 693 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 597 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 360 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 345 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 359 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 384 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 756 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 779 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 312 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 231 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 640 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 665 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 502 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 328 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 979 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1007 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 911 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 505 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -4,7 +4,7 @@
<item
android:id="@+id/action_show_pinned"
android:title="@string/pinned_toots"
android:icon="@drawable/ic_action_pin"
android:icon="@drawable/ic_pin_drop"
app:showAsAction="ifRoom" />
<item
android:id="@+id/action_open_browser"