Apply to notifications
This commit is contained in:
parent
cff81fbf77
commit
c6ebcd4195
|
@ -76,7 +76,7 @@ dependencies {
|
||||||
implementation 'com.vanniktech:emoji-one:0.6.0-SNAPSHOT'
|
implementation 'com.vanniktech:emoji-one:0.6.0-SNAPSHOT'
|
||||||
implementation 'com.oguzdev:CircularFloatingActionMenu:1.0.2'
|
implementation 'com.oguzdev:CircularFloatingActionMenu:1.0.2'
|
||||||
implementation 'com.github.franmontiel:LocaleChanger:0.9.2'
|
implementation 'com.github.franmontiel:LocaleChanger:0.9.2'
|
||||||
implementation 'com.github.stom79:SparkButton:1.0.9'
|
implementation 'com.github.stom79:SparkButton:1.0.10'
|
||||||
implementation 'com.github.GrenderG:Toasty:1.3.0'
|
implementation 'com.github.GrenderG:Toasty:1.3.0'
|
||||||
playstoreImplementation "io.github.kobakei:ratethisapp:$ratethisappLibraryVersion"
|
playstoreImplementation "io.github.kobakei:ratethisapp:$ratethisappLibraryVersion"
|
||||||
}
|
}
|
||||||
|
|
|
@ -138,6 +138,8 @@ public class NotificationsListAdapter extends RecyclerView.Adapter implements On
|
||||||
String typeString = "";
|
String typeString = "";
|
||||||
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
|
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
|
||||||
boolean expand_cw = sharedpreferences.getBoolean(Helper.SET_EXPAND_CW, false);
|
boolean expand_cw = sharedpreferences.getBoolean(Helper.SET_EXPAND_CW, false);
|
||||||
|
boolean confirmFav = sharedpreferences.getBoolean(Helper.SET_NOTIF_VALIDATION_FAV, false);
|
||||||
|
boolean confirmBoost = sharedpreferences.getBoolean(Helper.SET_NOTIF_VALIDATION, true);
|
||||||
|
|
||||||
if (theme == THEME_DARK ){
|
if (theme == THEME_DARK ){
|
||||||
holder.main_container_trans.setBackgroundColor(ContextCompat.getColor(context, R.color.notif_dark_1));
|
holder.main_container_trans.setBackgroundColor(ContextCompat.getColor(context, R.color.notif_dark_1));
|
||||||
|
@ -304,6 +306,8 @@ public class NotificationsListAdapter extends RecyclerView.Adapter implements On
|
||||||
|
|
||||||
holder.spark_button_fav.setActiveImageTint(R.color.marked_icon);
|
holder.spark_button_fav.setActiveImageTint(R.color.marked_icon);
|
||||||
holder.spark_button_reblog.setActiveImageTint(R.color.boost_icon);
|
holder.spark_button_reblog.setActiveImageTint(R.color.boost_icon);
|
||||||
|
holder.spark_button_fav.setDisableCircle(true);
|
||||||
|
holder.spark_button_reblog.setDisableCircle(true);
|
||||||
if( theme == THEME_DARK) {
|
if( theme == THEME_DARK) {
|
||||||
holder.spark_button_fav.setInActiveImageTint(R.color.action_dark);
|
holder.spark_button_fav.setInActiveImageTint(R.color.action_dark);
|
||||||
holder.spark_button_reblog.setInActiveImageTint(R.color.action_dark);
|
holder.spark_button_reblog.setInActiveImageTint(R.color.action_dark);
|
||||||
|
@ -481,13 +485,13 @@ public class NotificationsListAdapter extends RecyclerView.Adapter implements On
|
||||||
|
|
||||||
|
|
||||||
if( status.isFavAnimated()){
|
if( status.isFavAnimated()){
|
||||||
holder.spark_button_fav.setAnimationSpeed(2.0f);
|
holder.spark_button_fav.setAnimationSpeed(1.0f);
|
||||||
holder.spark_button_fav.playAnimation();
|
holder.spark_button_fav.playAnimation();
|
||||||
status.setFavAnimated(false);
|
status.setFavAnimated(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if( status.isBoostAnimated()){
|
if( status.isBoostAnimated()){
|
||||||
holder.spark_button_reblog.setAnimationSpeed(2.0f);
|
holder.spark_button_reblog.setAnimationSpeed(1.0f);
|
||||||
holder.spark_button_reblog.playAnimation();
|
holder.spark_button_reblog.playAnimation();
|
||||||
status.setBoostAnimated(false);
|
status.setBoostAnimated(false);
|
||||||
}
|
}
|
||||||
|
@ -495,16 +499,24 @@ public class NotificationsListAdapter extends RecyclerView.Adapter implements On
|
||||||
holder.spark_button_fav.setOnClickListener(new View.OnClickListener() {
|
holder.spark_button_fav.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if( !status.isFavourited())
|
if( !status.isFavourited() && confirmFav)
|
||||||
status.setFavAnimated(true);
|
status.setFavAnimated(true);
|
||||||
|
if( !status.isFavourited() && !confirmFav) {
|
||||||
|
status.setFavAnimated(true);
|
||||||
|
notifyNotificationChanged(notification);
|
||||||
|
}
|
||||||
CrossActions.doCrossAction(context, null, status, null, status.isFavourited()? API.StatusAction.UNFAVOURITE:API.StatusAction.FAVOURITE, notificationsListAdapter, NotificationsListAdapter.this, true);
|
CrossActions.doCrossAction(context, null, status, null, status.isFavourited()? API.StatusAction.UNFAVOURITE:API.StatusAction.FAVOURITE, notificationsListAdapter, NotificationsListAdapter.this, true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
holder.spark_button_reblog.setOnClickListener(new View.OnClickListener() {
|
holder.spark_button_reblog.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if( !status.isReblogged())
|
if( !status.isReblogged() && confirmBoost)
|
||||||
status.setBoostAnimated(true);
|
status.setBoostAnimated(true);
|
||||||
|
if( !status.isReblogged() && !confirmBoost) {
|
||||||
|
status.setBoostAnimated(true);
|
||||||
|
notifyNotificationChanged(notification);
|
||||||
|
}
|
||||||
CrossActions.doCrossAction(context, null, status, null, status.isReblogged()? API.StatusAction.UNREBLOG:API.StatusAction.REBLOG, notificationsListAdapter, NotificationsListAdapter.this, true);
|
CrossActions.doCrossAction(context, null, status, null, status.isReblogged()? API.StatusAction.UNREBLOG:API.StatusAction.REBLOG, notificationsListAdapter, NotificationsListAdapter.this, true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -447,6 +447,8 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
int truncate_toots_size = sharedpreferences.getInt(Helper.SET_TRUNCATE_TOOTS_SIZE, 0);
|
int truncate_toots_size = sharedpreferences.getInt(Helper.SET_TRUNCATE_TOOTS_SIZE, 0);
|
||||||
final int timeout = sharedpreferences.getInt(Helper.SET_NSFW_TIMEOUT, 5);
|
final int timeout = sharedpreferences.getInt(Helper.SET_NSFW_TIMEOUT, 5);
|
||||||
boolean share_details = sharedpreferences.getBoolean(Helper.SET_SHARE_DETAILS, true);
|
boolean share_details = sharedpreferences.getBoolean(Helper.SET_SHARE_DETAILS, true);
|
||||||
|
boolean confirmFav = sharedpreferences.getBoolean(Helper.SET_NOTIF_VALIDATION_FAV, false);
|
||||||
|
boolean confirmBoost = sharedpreferences.getBoolean(Helper.SET_NOTIF_VALIDATION, true);
|
||||||
|
|
||||||
if( type != RetrieveFeedsAsyncTask.Type.REMOTE_INSTANCE && !isCompactMode && displayBookmarkButton)
|
if( type != RetrieveFeedsAsyncTask.Type.REMOTE_INSTANCE && !isCompactMode && displayBookmarkButton)
|
||||||
holder.status_bookmark.setVisibility(View.VISIBLE);
|
holder.status_bookmark.setVisibility(View.VISIBLE);
|
||||||
|
@ -637,7 +639,10 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
|
|
||||||
//Redraws top icons (boost/reply)
|
//Redraws top icons (boost/reply)
|
||||||
final float scale = context.getResources().getDisplayMetrics().density;
|
final float scale = context.getResources().getDisplayMetrics().density;
|
||||||
|
holder.spark_button_fav.setActiveImage(R.drawable.ic_star);
|
||||||
|
holder.spark_button_fav.setInactiveImage(R.drawable.ic_star_border);
|
||||||
|
holder.spark_button_fav.setDisableCircle(true);
|
||||||
|
holder.spark_button_reblog.setDisableCircle(true);
|
||||||
holder.spark_button_fav.setActiveImageTint(R.color.marked_icon);
|
holder.spark_button_fav.setActiveImageTint(R.color.marked_icon);
|
||||||
holder.spark_button_reblog.setActiveImageTint(R.color.boost_icon);
|
holder.spark_button_reblog.setActiveImageTint(R.color.boost_icon);
|
||||||
if( theme == THEME_DARK) {
|
if( theme == THEME_DARK) {
|
||||||
|
@ -1213,6 +1218,11 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
} else {
|
} else {
|
||||||
holder.spark_button_fav.setChecked(false);
|
holder.spark_button_fav.setChecked(false);
|
||||||
}
|
}
|
||||||
|
}else {
|
||||||
|
status.setFavAnimated(false);
|
||||||
|
holder.spark_button_fav.setChecked(true);
|
||||||
|
holder.spark_button_fav.setAnimationSpeed(1.0f);
|
||||||
|
holder.spark_button_fav.playAnimation();
|
||||||
}
|
}
|
||||||
if( !status.isBoostAnimated()){
|
if( !status.isBoostAnimated()){
|
||||||
if( status.isReblogged()|| (status.getReblog() != null && status.getReblog().isReblogged())) {
|
if( status.isReblogged()|| (status.getReblog() != null && status.getReblog().isReblogged())) {
|
||||||
|
@ -1221,6 +1231,11 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
holder.spark_button_reblog.setChecked(false);
|
holder.spark_button_reblog.setChecked(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
status.setBoostAnimated(false);
|
||||||
|
holder.spark_button_reblog.setAnimationSpeed(1.0f);
|
||||||
|
holder.spark_button_reblog.playAnimation();
|
||||||
|
}
|
||||||
|
|
||||||
if( theme == THEME_DARK)
|
if( theme == THEME_DARK)
|
||||||
changeDrawableColor(context, R.drawable.ic_reply,R.color.action_dark);
|
changeDrawableColor(context, R.drawable.ic_reply,R.color.action_dark);
|
||||||
|
@ -1370,23 +1385,17 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if( status.isFavAnimated()){
|
|
||||||
holder.spark_button_fav.setAnimationSpeed(2.0f);
|
|
||||||
holder.spark_button_fav.playAnimation();
|
|
||||||
status.setFavAnimated(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
if( status.isBoostAnimated()){
|
|
||||||
holder.spark_button_reblog.setAnimationSpeed(2.0f);
|
|
||||||
holder.spark_button_reblog.playAnimation();
|
|
||||||
status.setBoostAnimated(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
holder.spark_button_fav.setOnClickListener(new View.OnClickListener() {
|
holder.spark_button_fav.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if( !status.isFavourited())
|
if( !status.isFavourited() && confirmFav)
|
||||||
status.setFavAnimated(true);
|
status.setFavAnimated(true);
|
||||||
|
if( !status.isFavourited() && !confirmFav) {
|
||||||
|
status.setFavAnimated(true);
|
||||||
|
notifyStatusChanged(status);
|
||||||
|
}
|
||||||
CrossActions.doCrossAction(context, type, status, null, (status.isFavourited()|| (status.getReblog() != null && status.getReblog().isFavourited()))? API.StatusAction.UNFAVOURITE:API.StatusAction.FAVOURITE, statusListAdapter, StatusListAdapter.this, true);
|
CrossActions.doCrossAction(context, type, status, null, (status.isFavourited()|| (status.getReblog() != null && status.getReblog().isFavourited()))? API.StatusAction.UNFAVOURITE:API.StatusAction.FAVOURITE, statusListAdapter, StatusListAdapter.this, true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -1394,8 +1403,12 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
holder.spark_button_reblog.setOnClickListener(new View.OnClickListener() {
|
holder.spark_button_reblog.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if( !status.isReblogged())
|
if( !status.isReblogged() && confirmBoost)
|
||||||
status.setBoostAnimated(true);
|
status.setBoostAnimated(true);
|
||||||
|
if( !status.isReblogged() && !confirmBoost) {
|
||||||
|
status.setBoostAnimated(true);
|
||||||
|
notifyStatusChanged(status);
|
||||||
|
}
|
||||||
CrossActions.doCrossAction(context, type, status, null, (status.isReblogged()|| (status.getReblog() != null && status.getReblog().isReblogged()))? API.StatusAction.UNREBLOG:API.StatusAction.REBLOG, statusListAdapter, StatusListAdapter.this, true);
|
CrossActions.doCrossAction(context, type, status, null, (status.isReblogged()|| (status.getReblog() != null && status.getReblog().isReblogged()))? API.StatusAction.UNREBLOG:API.StatusAction.REBLOG, statusListAdapter, StatusListAdapter.this, true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue