Make tooltips appear in SDK < 26
This commit is contained in:
parent
2f330f47c6
commit
1fc88d9ec8
|
@ -34,6 +34,7 @@ import android.os.CountDownTimer;
|
|||
import android.os.Environment;
|
||||
import android.os.Handler;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.widget.TooltipCompat;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
|
@ -1001,6 +1002,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
}
|
||||
|
||||
if( holder.fedilab_features != null) {
|
||||
TooltipCompat.setTooltipText(holder.fedilab_features, context.getString(R.string.app_features));
|
||||
holder.fedilab_features.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
@ -1029,11 +1031,13 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
else
|
||||
holder.custom_feature_bookmark.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_bookmark_white));
|
||||
|
||||
TooltipCompat.setTooltipText(holder.custom_feature_translate, context.getString(R.string.translate));
|
||||
holder.custom_feature_translate.setOnClickListener(view -> {
|
||||
translateToot(status);
|
||||
status.setCustomFeaturesDisplayed(false);
|
||||
notifyStatusChanged(status);
|
||||
});
|
||||
|
||||
holder.custom_feature_bookmark.setOnClickListener(view -> {
|
||||
bookmark(status);
|
||||
status.setCustomFeaturesDisplayed(false);
|
||||
|
@ -1045,24 +1049,29 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
notifyStatusChanged(status);
|
||||
return false;
|
||||
});
|
||||
|
||||
TooltipCompat.setTooltipText(holder.custom_feature_timed_mute, context.getString(R.string.timed_mute));
|
||||
holder.custom_feature_timed_mute.setOnClickListener(view -> {
|
||||
timedMuteAction(status);
|
||||
status.setCustomFeaturesDisplayed(false);
|
||||
notifyStatusChanged(status);
|
||||
});
|
||||
|
||||
TooltipCompat.setTooltipText(holder.custom_feature_schedule, context.getString(R.string.schedule_boost));
|
||||
holder.custom_feature_schedule.setOnClickListener(view -> {
|
||||
scheduleBoost(status);
|
||||
status.setCustomFeaturesDisplayed(false);
|
||||
notifyStatusChanged(status);
|
||||
});
|
||||
|
||||
TooltipCompat.setTooltipText(holder.custom_feature_mention, context.getString(R.string.mention_status));
|
||||
holder.custom_feature_mention.setOnClickListener(view -> {
|
||||
mention(status);
|
||||
status.setCustomFeaturesDisplayed(false);
|
||||
notifyStatusChanged(status);
|
||||
});
|
||||
|
||||
TooltipCompat.setTooltipText(holder.custom_feature_cache, context.getString(R.string.refresh_cache));
|
||||
holder.custom_feature_cache.setOnClickListener(view -> {
|
||||
new ManageCachedStatusAsyncTask(context, status.getId(), StatusListAdapter.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
status.setCustomFeaturesDisplayed(false);
|
||||
|
|
|
@ -201,7 +201,6 @@
|
|||
android:padding="2dp"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/ic_logo_button"
|
||||
android:tooltipText="@string/app_features"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@id/status_pp_section"
|
||||
app:layout_constraintStart_toStartOf="@id/status_pp_section"
|
||||
|
@ -948,7 +947,6 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:background="@color/custom_features_panel_background"
|
||||
android:paddingStart="2dp"
|
||||
android:paddingTop="4dp"
|
||||
|
@ -969,7 +967,6 @@
|
|||
android:background="@color/mastodonC4"
|
||||
android:contentDescription="@string/bookmark_add"
|
||||
android:src="@drawable/ic_bookmark_white"
|
||||
android:tooltipText="@string/bookmark_add"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/custom_feature_translate"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
@ -985,7 +982,6 @@
|
|||
android:background="@color/mastodonC4"
|
||||
android:contentDescription="@string/translate"
|
||||
android:src="@drawable/ic_translate_white"
|
||||
android:tooltipText="@string/translate"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/custom_feature_timed_mute"
|
||||
app:layout_constraintStart_toEndOf="@id/custom_feature_bookmark"
|
||||
|
@ -1001,7 +997,6 @@
|
|||
android:background="@color/mastodonC4"
|
||||
android:contentDescription="@string/timed_mute"
|
||||
android:src="@drawable/ic_timelapse"
|
||||
android:tooltipText="@string/timed_mute"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/custom_feature_schedule"
|
||||
app:layout_constraintStart_toEndOf="@id/custom_feature_translate"
|
||||
|
@ -1017,7 +1012,6 @@
|
|||
android:background="@color/mastodonC4"
|
||||
android:contentDescription="@string/schedule"
|
||||
android:src="@drawable/ic_schedule"
|
||||
android:tooltipText="@string/schedule_boost"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/custom_feature_mention"
|
||||
app:layout_constraintStart_toEndOf="@id/custom_feature_timed_mute"
|
||||
|
@ -1034,7 +1028,6 @@
|
|||
android:background="@color/mastodonC4"
|
||||
android:contentDescription="@string/mention_account"
|
||||
android:src="@drawable/ic_mention_white"
|
||||
android:tooltipText="@string/mention_status"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/custom_feature_cache"
|
||||
app:layout_constraintStart_toEndOf="@id/custom_feature_schedule"
|
||||
|
@ -1050,7 +1043,6 @@
|
|||
android:background="@color/mastodonC4"
|
||||
android:contentDescription="@string/refresh_cache"
|
||||
android:src="@drawable/ic_refresh"
|
||||
android:tooltipText="@string/refresh_cache"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/custom_feature_mention"
|
||||
|
|
Loading…
Reference in New Issue