Add an option to show individual timeout bars for each entry

Closes #166
This commit is contained in:
Jakob Nixdorf 2020-04-23 22:10:36 +02:00
parent 36b84ae0bc
commit c5e4ba1e19
No known key found for this signature in database
GPG key ID: BE99BF86574A7DBC
9 changed files with 541 additions and 499 deletions

View file

@ -583,4 +583,8 @@ public class Settings {
public boolean isHideGlobalTimeoutEnabled() { public boolean isHideGlobalTimeoutEnabled() {
return getBoolean(R.string.settings_key_hide_global_timeout, false); return getBoolean(R.string.settings_key_hide_global_timeout, false);
} }
public boolean isShowIndividualTimeoutsEnabled() {
return getBoolean(R.string.settings_key_show_individual_timeouts, false);
}
} }

View file

@ -23,8 +23,6 @@
package org.shadowice.flocke.andotp.View; package org.shadowice.flocke.andotp.View;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.graphics.Bitmap; import android.graphics.Bitmap;
@ -231,15 +229,17 @@ public class EntriesCardAdapter extends RecyclerView.Adapter<EntryViewHolder>
for (Entry e : entries) { for (Entry e : entries) {
if (e.isTimeBased()) { if (e.isTimeBased()) {
boolean cardVisible = !settings.getTapToReveal() || e.isVisible();
boolean item_changed = e.updateOTP(); boolean item_changed = e.updateOTP();
boolean color_changed = false; boolean color_changed = false;
//Check color change only if highlighting token feature is enabled // Check color change only if highlighting token feature is enabled and the entry is visible
if(settings.isHighlightTokenOptionEnabled()) { if(settings.isHighlightTokenOptionEnabled())
color_changed = e.hasColorChanged(); color_changed = cardVisible && e.hasColorChanged();
}
change = change || item_changed || e.hasNonDefaultPeriod() || color_changed; change = change || item_changed || color_changed ||
(cardVisible && (e.hasNonDefaultPeriod() || settings.isShowIndividualTimeoutsEnabled()));
} }
} }

View file

@ -198,9 +198,13 @@ public class EntryViewHolder extends RecyclerView.ViewHolder
thumbnailImg.setImageBitmap(EntryThumbnail.getThumbnailGraphic(context, entry.getIssuer(), entry.getLabel(), thumbnailSize, entry.getThumbnail())); thumbnailImg.setImageBitmap(EntryThumbnail.getThumbnailGraphic(context, entry.getIssuer(), entry.getLabel(), thumbnailSize, entry.getThumbnail()));
} }
if (entry.isTimeBased() && entry.hasNonDefaultPeriod()) { if (entry.isTimeBased() && (entry.hasNonDefaultPeriod() || settings.isShowIndividualTimeoutsEnabled())) {
progressBar.setVisibility(View.VISIBLE); if (!this.tapToReveal || entry.isVisible()) {
updateProgress(entry); progressBar.setVisibility(View.VISIBLE);
updateProgress(entry);
} else {
progressBar.setVisibility(View.INVISIBLE);
}
} else { } else {
progressBar.setVisibility(View.GONE); progressBar.setVisibility(View.GONE);
} }

View file

@ -39,201 +39,209 @@
</FrameLayout> </FrameLayout>
<LinearLayout <LinearLayout
android:orientation="horizontal" android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content">
android:paddingTop="@dimen/activity_margin_xsmall"
android:paddingBottom="@dimen/activity_margin_xsmall"
android:paddingStart="@dimen/activity_margin"
android:paddingEnd="@dimen/activity_margin_small"
android:gravity="center_vertical"
android:baselineAligned="false" >
<LinearLayout
android:orientation="vertical"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<LinearLayout
android:id="@+id/valueLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone">
<ImageView
android:id="@+id/valueImg"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/activity_margin_small"
app:srcCompat="@drawable/ic_visibility_visible"/>
<TextView
android:textDirection="ltr"
android:id="@+id/valueText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="?android:attr/textColorSecondary"
android:textSize="24sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="@+id/coverLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/coverImg"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/activity_margin_small"
android:alpha="0.4"
app:srcCompat="@drawable/ic_visibility_invisible"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:alpha="0.4"
android:textColor="?android:attr/textColorSecondary"
android:textSize="24sp"
android:textStyle="bold"
android:text="@string/label_hidden" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/textViewIssuer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:ellipsize="end"
android:textSize="18sp"
android:text="Issuer"
android:textStyle="bold" />
<TextView
android:id="@+id/textViewSeparator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:textSize="18sp"
android:text="@string/card_separator" />
<TextView
android:id="@+id/textViewLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:ellipsize="end"
android:text="Label"
android:textSize="18sp" />
</LinearLayout>
<TextView
android:id="@+id/textViewTags"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:ellipsize="end"
android:text="Tags"
android:textSize="13.5sp" />
</LinearLayout>
<LinearLayout <LinearLayout
android:orientation="horizontal" android:orientation="horizontal"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content"
android:paddingTop="@dimen/activity_margin_xsmall"
android:paddingBottom="@dimen/activity_margin_xsmall"
android:paddingStart="@dimen/activity_margin"
android:paddingEnd="@dimen/activity_margin_small"
android:gravity="center_vertical"
android:baselineAligned="false" >
<LinearLayout <LinearLayout
android:id="@+id/customPeriodLayout" android:orientation="vertical"
android:layout_width="wrap_content" android:layout_width="0dip"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/activity_horizontal_margin" android:layout_weight="1">
android:visibility="gone"
android:orientation="horizontal" >
<ImageView <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="wrap_content" >
app:srcCompat="@drawable/ic_alarm_gray" />
<TextView <LinearLayout
android:id="@+id/customPeriod" android:id="@+id/valueLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone">
<ImageView
android:id="@+id/valueImg"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/activity_margin_small"
app:srcCompat="@drawable/ic_visibility_visible"/>
<TextView
android:textDirection="ltr"
android:id="@+id/valueText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="?android:attr/textColorSecondary"
android:textSize="24sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="@+id/coverLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/coverImg"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/activity_margin_small"
android:alpha="0.4"
app:srcCompat="@drawable/ic_visibility_invisible"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:alpha="0.4"
android:textColor="?android:attr/textColorSecondary"
android:textSize="24sp"
android:textStyle="bold"
android:text="@string/label_hidden" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textStyle="bold" /> android:orientation="horizontal">
<TextView
android:id="@+id/textViewIssuer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:ellipsize="end"
android:textSize="18sp"
android:text="Issuer"
android:textStyle="bold" />
<TextView
android:id="@+id/textViewSeparator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:textSize="18sp"
android:text="@string/card_separator" />
<TextView
android:id="@+id/textViewLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:ellipsize="end"
android:text="Label"
android:textSize="18sp" />
</LinearLayout>
<TextView
android:id="@+id/textViewTags"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:ellipsize="end"
android:text="Tags"
android:textSize="13.5sp" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/counterLayout" android:orientation="horizontal"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content">
android:layout_gravity="center_vertical"
android:padding="@dimen/activity_horizontal_margin"
android:gravity="center"
android:visibility="visible"
android:orientation="vertical" >
<TextView <LinearLayout
android:id="@+id/customPeriodLayout"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textStyle="bold" android:layout_marginEnd="@dimen/activity_horizontal_margin"
android:text="@string/label_counter_symbol" /> android:visibility="gone"
android:orientation="horizontal" >
<TextView <ImageView
android:id="@+id/counter" android:layout_width="wrap_content"
android:layout_height="match_parent"
app:srcCompat="@drawable/ic_alarm_gray" />
<TextView
android:id="@+id/customPeriod"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="@+id/counterLayout"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textStyle="bold" /> android:layout_gravity="center_vertical"
android:padding="@dimen/activity_horizontal_margin"
android:gravity="center"
android:visibility="visible"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:text="@string/label_counter_symbol" />
<TextView
android:id="@+id/counter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold" />
</LinearLayout>
<ImageButton
android:id="@+id/copyButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:padding="@dimen/activity_margin_small"
android:background="?android:attr/selectableItemBackground"
app:srcCompat="@drawable/ic_content_copy_gray" />
<ImageButton
android:id="@+id/menuButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:padding="@dimen/activity_margin_small"
android:background="?android:attr/selectableItemBackground"
app:srcCompat="@drawable/ic_more_vert_gray" />
</LinearLayout> </LinearLayout>
<ImageButton
android:id="@+id/copyButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:padding="@dimen/activity_margin_small"
android:background="?android:attr/selectableItemBackground"
app:srcCompat="@drawable/ic_content_copy_gray" />
<ImageButton
android:id="@+id/menuButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:padding="@dimen/activity_margin_small"
android:background="?android:attr/selectableItemBackground"
app:srcCompat="@drawable/ic_more_vert_gray" />
</LinearLayout> </LinearLayout>
</LinearLayout> <me.zhanghai.android.materialprogressbar.MaterialProgressBar
</LinearLayout> android:id="@+id/cardProgressBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:max="3000"
android:progress="1500"
app:mpb_progressStyle="horizontal"
app:mpb_useIntrinsicPadding="false"
app:mpb_showProgressBackground="false"
style="@style/Widget.MaterialProgressBar.ProgressBar.Horizontal.NoPadding" />
<me.zhanghai.android.materialprogressbar.MaterialProgressBar </LinearLayout>
android:id="@+id/cardProgressBar"
android:layout_width="match_parent" </LinearLayout>
android:layout_height="wrap_content"
android:visibility="gone"
android:max="3000"
android:progress="1500"
app:mpb_progressStyle="horizontal"
app:mpb_useIntrinsicPadding="false"
app:mpb_showProgressBackground="false"
style="@style/Widget.MaterialProgressBar.ProgressBar.Horizontal.NoPadding" />
</LinearLayout> </LinearLayout>

View file

@ -39,201 +39,209 @@
</FrameLayout> </FrameLayout>
<LinearLayout <LinearLayout
android:orientation="horizontal" android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content">
android:paddingTop="@dimen/activity_margin_small"
android:paddingBottom="@dimen/activity_margin_small"
android:paddingStart="@dimen/activity_margin"
android:paddingEnd="@dimen/activity_margin_small"
android:gravity="center_vertical"
android:baselineAligned="false" >
<LinearLayout
android:orientation="vertical"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<LinearLayout
android:id="@+id/valueLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone">
<ImageView
android:id="@+id/valueImg"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/activity_margin_small"
app:srcCompat="@drawable/ic_visibility_visible"/>
<TextView
android:textDirection="ltr"
android:id="@+id/valueText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="?android:attr/textColorSecondary"
android:textSize="28sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="@+id/coverLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/coverImg"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/activity_margin_small"
android:alpha="0.4"
app:srcCompat="@drawable/ic_visibility_invisible"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:alpha="0.4"
android:textColor="?android:attr/textColorSecondary"
android:textSize="28sp"
android:textStyle="bold"
android:text="@string/label_hidden" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/textViewIssuer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:ellipsize="end"
android:textSize="18sp"
android:text="Issuer"
android:textStyle="bold" />
<TextView
android:id="@+id/textViewSeparator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:textSize="18sp"
android:text="@string/card_separator" />
<TextView
android:id="@+id/textViewLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:ellipsize="end"
android:text="Label"
android:textSize="18sp" />
</LinearLayout>
<TextView
android:id="@+id/textViewTags"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:ellipsize="end"
android:text="Tags"
android:textSize="13.5sp" />
</LinearLayout>
<LinearLayout <LinearLayout
android:orientation="horizontal" android:orientation="horizontal"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content"
android:paddingTop="@dimen/activity_margin_small"
android:paddingBottom="@dimen/activity_margin_small"
android:paddingStart="@dimen/activity_margin"
android:paddingEnd="@dimen/activity_margin_small"
android:gravity="center_vertical"
android:baselineAligned="false" >
<LinearLayout <LinearLayout
android:id="@+id/customPeriodLayout" android:orientation="vertical"
android:layout_width="wrap_content" android:layout_width="0dip"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/activity_horizontal_margin" android:layout_weight="1">
android:visibility="gone"
android:orientation="horizontal" >
<ImageView <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="wrap_content" >
app:srcCompat="@drawable/ic_alarm_gray" />
<TextView <LinearLayout
android:id="@+id/customPeriod" android:id="@+id/valueLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone">
<ImageView
android:id="@+id/valueImg"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/activity_margin_small"
app:srcCompat="@drawable/ic_visibility_visible"/>
<TextView
android:textDirection="ltr"
android:id="@+id/valueText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="?android:attr/textColorSecondary"
android:textSize="28sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="@+id/coverLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/coverImg"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/activity_margin_small"
android:alpha="0.4"
app:srcCompat="@drawable/ic_visibility_invisible"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:alpha="0.4"
android:textColor="?android:attr/textColorSecondary"
android:textSize="28sp"
android:textStyle="bold"
android:text="@string/label_hidden" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textStyle="bold" /> android:orientation="horizontal">
<TextView
android:id="@+id/textViewIssuer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:ellipsize="end"
android:textSize="18sp"
android:text="Issuer"
android:textStyle="bold" />
<TextView
android:id="@+id/textViewSeparator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:textSize="18sp"
android:text="@string/card_separator" />
<TextView
android:id="@+id/textViewLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:ellipsize="end"
android:text="Label"
android:textSize="18sp" />
</LinearLayout>
<TextView
android:id="@+id/textViewTags"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:ellipsize="end"
android:text="Tags"
android:textSize="13.5sp" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/counterLayout" android:orientation="horizontal"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content">
android:layout_gravity="center_vertical"
android:padding="@dimen/activity_horizontal_margin"
android:gravity="center"
android:visibility="visible"
android:orientation="vertical" >
<TextView <LinearLayout
android:id="@+id/customPeriodLayout"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textStyle="bold" android:layout_marginEnd="@dimen/activity_horizontal_margin"
android:text="@string/label_counter_symbol" /> android:visibility="gone"
android:orientation="horizontal" >
<TextView <ImageView
android:id="@+id/counter" android:layout_width="wrap_content"
android:layout_height="match_parent"
app:srcCompat="@drawable/ic_alarm_gray" />
<TextView
android:id="@+id/customPeriod"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="@+id/counterLayout"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textStyle="bold" /> android:layout_gravity="center_vertical"
android:padding="@dimen/activity_horizontal_margin"
android:gravity="center"
android:visibility="visible"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:text="@string/label_counter_symbol" />
<TextView
android:id="@+id/counter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold" />
</LinearLayout>
<ImageButton
android:id="@+id/copyButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:padding="@dimen/activity_margin_small"
android:background="?android:attr/selectableItemBackground"
app:srcCompat="@drawable/ic_content_copy_gray" />
<ImageButton
android:id="@+id/menuButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:padding="@dimen/activity_margin_small"
android:background="?android:attr/selectableItemBackground"
app:srcCompat="@drawable/ic_more_vert_gray" />
</LinearLayout> </LinearLayout>
<ImageButton
android:id="@+id/copyButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:padding="@dimen/activity_margin_small"
android:background="?android:attr/selectableItemBackground"
app:srcCompat="@drawable/ic_content_copy_gray" />
<ImageButton
android:id="@+id/menuButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:padding="@dimen/activity_margin_small"
android:background="?android:attr/selectableItemBackground"
app:srcCompat="@drawable/ic_more_vert_gray" />
</LinearLayout> </LinearLayout>
</LinearLayout> <me.zhanghai.android.materialprogressbar.MaterialProgressBar
</LinearLayout> android:id="@+id/cardProgressBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:max="3000"
android:progress="1500"
app:mpb_progressStyle="horizontal"
app:mpb_useIntrinsicPadding="false"
app:mpb_showProgressBackground="false"
style="@style/Widget.MaterialProgressBar.ProgressBar.Horizontal.NoPadding" />
<me.zhanghai.android.materialprogressbar.MaterialProgressBar </LinearLayout>
android:id="@+id/cardProgressBar"
android:layout_width="match_parent" </LinearLayout>
android:layout_height="wrap_content"
android:visibility="gone"
android:max="3000"
android:progress="1500"
app:mpb_progressStyle="horizontal"
app:mpb_useIntrinsicPadding="false"
app:mpb_showProgressBackground="false"
style="@style/Widget.MaterialProgressBar.ProgressBar.Horizontal.NoPadding" />
</LinearLayout> </LinearLayout>

View file

@ -39,187 +39,195 @@
</FrameLayout> </FrameLayout>
<LinearLayout <LinearLayout
android:orientation="horizontal" android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content">
android:padding="@dimen/activity_margin"
android:gravity="center_vertical"
android:baselineAligned="false" >
<LinearLayout
android:orientation="vertical"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<LinearLayout
android:id="@+id/valueLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone">
<ImageView
android:id="@+id/valueImg"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/activity_margin_small"
app:srcCompat="@drawable/ic_visibility_visible"/>
<TextView
android:textDirection="ltr"
android:id="@+id/valueText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="?android:attr/textColorSecondary"
android:textSize="28sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="@+id/coverLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/coverImg"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/activity_margin_small"
android:alpha="0.4"
app:srcCompat="@drawable/ic_visibility_invisible"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:alpha="0.4"
android:textColor="?android:attr/textColorSecondary"
android:textSize="28sp"
android:textStyle="bold"
android:text="@string/label_hidden" />
</LinearLayout>
</LinearLayout>
<TextView
android:id="@+id/textViewIssuer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:ellipsize="end"
android:textSize="18sp"
android:textStyle="bold" />
<TextView
android:id="@+id/textViewSeparator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="0"
android:visibility="gone" />
<TextView
android:id="@+id/textViewLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:ellipsize="end"
android:textSize="18sp" />
<TextView
android:id="@+id/textViewTags"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:ellipsize="end"
android:textSize="13.5sp" />
</LinearLayout>
<LinearLayout <LinearLayout
android:orientation="horizontal" android:orientation="horizontal"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content"
android:padding="@dimen/activity_margin"
android:gravity="center_vertical"
android:baselineAligned="false" >
<LinearLayout <LinearLayout
android:id="@+id/customPeriodLayout" android:orientation="vertical"
android:layout_width="wrap_content" android:layout_width="0dip"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/activity_horizontal_margin" android:layout_weight="1">
android:visibility="gone"
android:orientation="horizontal" >
<ImageView <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="wrap_content" >
app:srcCompat="@drawable/ic_alarm_gray" />
<LinearLayout
android:id="@+id/valueLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone">
<ImageView
android:id="@+id/valueImg"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/activity_margin_small"
app:srcCompat="@drawable/ic_visibility_visible"/>
<TextView
android:textDirection="ltr"
android:id="@+id/valueText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="?android:attr/textColorSecondary"
android:textSize="28sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="@+id/coverLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/coverImg"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/activity_margin_small"
android:alpha="0.4"
app:srcCompat="@drawable/ic_visibility_invisible"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:alpha="0.4"
android:textColor="?android:attr/textColorSecondary"
android:textSize="28sp"
android:textStyle="bold"
android:text="@string/label_hidden" />
</LinearLayout>
</LinearLayout>
<TextView <TextView
android:id="@+id/customPeriod" android:id="@+id/textViewIssuer"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:maxLines="1"
android:ellipsize="end"
android:textSize="18sp"
android:textStyle="bold" /> android:textStyle="bold" />
<TextView
android:id="@+id/textViewSeparator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="0"
android:visibility="gone" />
<TextView
android:id="@+id/textViewLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:ellipsize="end"
android:textSize="18sp" />
<TextView
android:id="@+id/textViewTags"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:ellipsize="end"
android:textSize="13.5sp" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/counterLayout" android:orientation="horizontal"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content">
android:layout_gravity="center_vertical"
android:padding="@dimen/activity_horizontal_margin"
android:gravity="center"
android:visibility="visible"
android:orientation="vertical" >
<TextView <LinearLayout
android:id="@+id/customPeriodLayout"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textStyle="bold" android:layout_marginEnd="@dimen/activity_horizontal_margin"
android:text="@string/label_counter_symbol" /> android:visibility="gone"
android:orientation="horizontal" >
<TextView <ImageView
android:id="@+id/counter" android:layout_width="wrap_content"
android:layout_height="match_parent"
app:srcCompat="@drawable/ic_alarm_gray" />
<TextView
android:id="@+id/customPeriod"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="@+id/counterLayout"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textStyle="bold" /> android:layout_gravity="center_vertical"
android:padding="@dimen/activity_horizontal_margin"
android:gravity="center"
android:visibility="visible"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:text="@string/label_counter_symbol" />
<TextView
android:id="@+id/counter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold" />
</LinearLayout>
<ImageButton
android:id="@+id/copyButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:padding="@dimen/activity_margin_small"
android:background="?android:attr/selectableItemBackground"
app:srcCompat="@drawable/ic_content_copy_gray" />
<ImageButton
android:id="@+id/menuButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:padding="@dimen/activity_margin_small"
android:background="?android:attr/selectableItemBackground"
app:srcCompat="@drawable/ic_more_vert_gray" />
</LinearLayout> </LinearLayout>
<ImageButton
android:id="@+id/copyButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:padding="@dimen/activity_margin_small"
android:background="?android:attr/selectableItemBackground"
app:srcCompat="@drawable/ic_content_copy_gray" />
<ImageButton
android:id="@+id/menuButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:padding="@dimen/activity_margin_small"
android:background="?android:attr/selectableItemBackground"
app:srcCompat="@drawable/ic_more_vert_gray" />
</LinearLayout> </LinearLayout>
</LinearLayout> <me.zhanghai.android.materialprogressbar.MaterialProgressBar
</LinearLayout> android:id="@+id/cardProgressBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:max="3000"
android:progress="1500"
app:mpb_progressStyle="horizontal"
app:mpb_useIntrinsicPadding="false"
app:mpb_showProgressBackground="false"
style="@style/Widget.MaterialProgressBar.ProgressBar.Horizontal.NoPadding" />
<me.zhanghai.android.materialprogressbar.MaterialProgressBar </LinearLayout>
android:id="@+id/cardProgressBar"
android:layout_width="match_parent" </LinearLayout>
android:layout_height="wrap_content"
android:visibility="gone"
android:max="3000"
android:progress="1500"
app:mpb_progressStyle="horizontal"
app:mpb_useIntrinsicPadding="false"
app:mpb_showProgressBackground="false"
style="@style/Widget.MaterialProgressBar.ProgressBar.Horizontal.NoPadding" />
</LinearLayout> </LinearLayout>

View file

@ -34,6 +34,7 @@
<string name="settings_key_search_includes" translatable="false">pref_search_includes</string> <string name="settings_key_search_includes" translatable="false">pref_search_includes</string>
<string name="settings_key_label_highlight_token" translatable="false">pref_label_highlight_token</string> <string name="settings_key_label_highlight_token" translatable="false">pref_label_highlight_token</string>
<string name="settings_key_hide_global_timeout" translatable="false">pref_hide_global_timeout</string> <string name="settings_key_hide_global_timeout" translatable="false">pref_hide_global_timeout</string>
<string name="settings_key_show_individual_timeouts" translatable="false">pref_show_individual_timeouts</string>
<string name="settings_key_backup_append_date_time" translatable="false">pref_backup_append_date_time</string> <string name="settings_key_backup_append_date_time" translatable="false">pref_backup_append_date_time</string>
<string name="settings_key_backup_ask" translatable="false">pref_backup_ask</string> <string name="settings_key_backup_ask" translatable="false">pref_backup_ask</string>

View file

@ -33,6 +33,7 @@
<string name="settings_title_search_includes">Search behavior</string> <string name="settings_title_search_includes">Search behavior</string>
<string name="settings_title_label_highlight_token">Highlight expiring tokens</string> <string name="settings_title_label_highlight_token">Highlight expiring tokens</string>
<string name="settings_title_hide_global_timeout">Hide global timeout bar</string> <string name="settings_title_hide_global_timeout">Hide global timeout bar</string>
<string name="settings_title_show_individual_timeouts">Show individual timeouts</string>
<string name="settings_title_backup_append_date">Append date to filename</string> <string name="settings_title_backup_append_date">Append date to filename</string>
<string name="settings_title_backup_ask">Ask for filename</string> <string name="settings_title_backup_ask">Ask for filename</string>
@ -72,7 +73,9 @@
<string name="settings_desc_minimize_on_copy">App will be minimized when you copy the OTP to clipboard</string> <string name="settings_desc_minimize_on_copy">App will be minimized when you copy the OTP to clipboard</string>
<string name="settings_desc_search_includes">Specify which values should be included when searching</string> <string name="settings_desc_search_includes">Specify which values should be included when searching</string>
<string name="settings_desc_label_highlight_token">Highlights token in red if it\'s expiring in 8 seconds</string> <string name="settings_desc_label_highlight_token">Highlights token in red if it\'s expiring in 8 seconds</string>
<string name="settings_desc_hide_global_timeout">Hide the global timeout bar shown at the top of the screen.</string> <string name="settings_desc_hide_global_timeout">Hide the global timeout bar shown at the top of the screen</string>
<string name="settings_desc_show_individual_timeouts">Show an individual timeout bar for every entry.
This can slow down the app, only enable if really necessary.</string>
<string name="settings_desc_backup_append_date">Append the current date and time to the suggested <string name="settings_desc_backup_append_date">Append the current date and time to the suggested
backup filename</string> backup filename</string>

View file

@ -167,6 +167,12 @@
android:summary="@string/settings_desc_hide_global_timeout" android:summary="@string/settings_desc_hide_global_timeout"
android:defaultValue="false" /> android:defaultValue="false" />
<CheckBoxPreference
android:key="@string/settings_key_show_individual_timeouts"
android:title="@string/settings_title_show_individual_timeouts"
android:summary="@string/settings_desc_show_individual_timeouts"
android:defaultValue="false" />
</PreferenceCategory> </PreferenceCategory>
<PreferenceCategory <PreferenceCategory