Fixed text view

pull/174/head
M66B 5 years ago
parent e8cc2bdddf
commit f2d534dcdf

@ -0,0 +1,60 @@
package eu.faircode.email;
/*
This file is part of FairEmail.
FairEmail is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
FairEmail is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with FairEmail. If not, see <http://www.gnu.org/licenses/>.
Copyright 2018-2020 by Marcel Bokhorst (M66B)
*/
import android.content.Context;
import android.util.AttributeSet;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.AppCompatTextView;
public class FixedTextView extends AppCompatTextView {
public FixedTextView(@NonNull Context context) {
super(context);
}
public FixedTextView(@NonNull Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
}
public FixedTextView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@Override
public boolean performLongClick() {
try {
return super.performLongClick();
} catch (IllegalStateException ex) {
/*
java.lang.IllegalStateException: Drag shadow dimensions must be positive
at android.view.View.startDragAndDrop(View.java:27316)
at android.widget.Editor.startDragAndDrop(Editor.java:1340)
at android.widget.Editor.performLongClick(Editor.java:1374)
at android.widget.TextView.performLongClick(TextView.java:13544)
at android.view.View.performLongClick(View.java:7928)
at android.view.View$CheckForLongPress.run(View.java:29321)
*/
Log.w(ex);
return false;
}
}
}

@ -16,7 +16,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvHeaders"
android:layout_width="0dp"
android:layout_height="wrap_content"

@ -47,7 +47,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/vSeparatorHeader" />
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvFrom"
android:layout_width="0dp"
android:layout_height="wrap_content"
@ -69,7 +69,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvFrom" />
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvTo"
android:layout_width="0dp"
android:layout_height="wrap_content"
@ -91,7 +91,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvTo" />
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvReplyTo"
android:layout_width="0dp"
android:layout_height="wrap_content"
@ -113,7 +113,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvReplyTo" />
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvCc"
android:layout_width="0dp"
android:layout_height="wrap_content"
@ -135,7 +135,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvCc" />
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvSent"
android:layout_width="0dp"
android:layout_height="wrap_content"
@ -157,7 +157,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvSent" />
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvReceived"
android:layout_width="0dp"
android:layout_height="wrap_content"
@ -169,7 +169,7 @@
app:layout_constraintStart_toEndOf="@id/tvReceivedTitle"
app:layout_constraintTop_toBottomOf="@id/tvSent" />
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvSubject"
android:layout_width="0dp"
android:layout_height="wrap_content"
@ -209,7 +209,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/rvAttachment" />
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvBody"
android:layout_width="0dp"
android:layout_height="wrap_content"

@ -6,7 +6,7 @@
android:layout_height="match_parent"
tools:context="eu.faircode.email.ActivityView">
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvVersion"
android:layout_width="wrap_content"
android:layout_height="wrap_content"

@ -251,7 +251,6 @@
android:text="@string/title_setup_password_chars"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?attr/colorWarning"
android:textIsSelectable="true"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tilPassword" />
@ -852,7 +851,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbIdentity" />
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvError"
android:layout_width="wrap_content"
android:layout_height="wrap_content"

@ -310,7 +310,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/etBody" />
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvSignature"
android:layout_width="0dp"
android:layout_height="wrap_content"
@ -403,7 +403,7 @@
app:barrierDirection="bottom"
app:constraint_referenced_ids="ibCloseRefHint,tvReferenceHint,ibReferenceEdit,ibReferenceImages" />
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvReference"
android:layout_width="0dp"
android:layout_height="wrap_content"

@ -105,7 +105,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvSelectHint" />
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvError"
android:layout_width="wrap_content"
android:layout_height="wrap_content"

@ -438,7 +438,6 @@
android:text="@string/title_setup_password_chars"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?attr/colorWarning"
android:textIsSelectable="true"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tilPassword" />
@ -655,7 +654,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnSave" />
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvError"
android:layout_width="wrap_content"
android:layout_height="wrap_content"

@ -109,7 +109,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvGmailHint" />
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvError"
android:layout_width="wrap_content"
android:layout_height="wrap_content"

@ -156,7 +156,7 @@
app:layout_constraintTop_toBottomOf="@id/tvExperimentsHint"
app:switchPadding="12dp" />
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvUuid"
android:layout_width="0dp"
android:layout_height="wrap_content"
@ -270,7 +270,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvMemoryClass" />
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvFingerprint"
android:layout_width="0dp"
android:layout_height="wrap_content"

@ -171,7 +171,6 @@
android:text="@string/title_setup_password_chars"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?attr/colorWarning"
android:textIsSelectable="true"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tilPassword" />
@ -384,7 +383,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnSave" />
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvError"
android:layout_width="wrap_content"
android:layout_height="wrap_content"

@ -69,7 +69,6 @@
android:text="@string/title_setup_password_chars"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?attr/colorWarning"
android:textIsSelectable="true"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tilPassword" />
@ -116,7 +115,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnCheck" />
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvError"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -128,7 +127,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvErrorTitle" />
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvErrorHint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"

@ -665,7 +665,6 @@
android:layout_marginTop="12dp"
android:text="@string/title_rule_automation_hint"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textIsSelectable="true"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/cbCc" />

@ -223,7 +223,6 @@
android:text="@string/title_no_primary_drafts"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?attr/colorWarning"
android:textIsSelectable="true"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnAccount" />
@ -333,7 +332,6 @@
android:text="@string/title_no_identities"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?attr/colorWarning"
android:textIsSelectable="true"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnIdentity" />

@ -110,7 +110,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/barrier_action" />
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvSubmitter"
android:layout_width="0dp"
android:layout_height="wrap_content"
@ -135,7 +135,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvSubmitter" />
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvDeliveredTo"
android:layout_width="0dp"
android:layout_height="wrap_content"
@ -160,7 +160,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvDeliveredTo" />
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvFromEx"
android:layout_width="0dp"
android:layout_height="wrap_content"
@ -185,7 +185,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvFromEx" />
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvTo"
android:layout_width="0dp"
android:layout_height="wrap_content"
@ -210,7 +210,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvTo" />
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvReplyTo"
android:layout_width="0dp"
android:layout_height="wrap_content"
@ -235,7 +235,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvReplyTo" />
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvCc"
android:layout_width="0dp"
android:layout_height="wrap_content"
@ -260,7 +260,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvCc" />
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvBcc"
android:layout_width="0dp"
android:layout_height="wrap_content"
@ -285,7 +285,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvBcc" />
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvIdentity"
android:layout_width="0dp"
android:layout_height="wrap_content"
@ -310,7 +310,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvIdentity" />
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvSent"
android:layout_width="0dp"
android:layout_height="wrap_content"
@ -335,7 +335,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvSent" />
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvReceived"
android:layout_width="0dp"
android:layout_height="wrap_content"
@ -360,7 +360,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvReceived" />
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvSizeEx"
android:layout_width="0dp"
android:layout_height="wrap_content"
@ -386,7 +386,7 @@
tvSentTitle,tvReceivedTitle,
tvSizeExTitle" />
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvSubjectEx"
android:layout_width="0dp"
android:layout_height="wrap_content"
@ -399,7 +399,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvSizeEx" />
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvFlags"
android:layout_width="0dp"
android:layout_height="wrap_content"
@ -412,7 +412,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvSubjectEx" />
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvKeywordsEx"
android:layout_width="0dp"
android:layout_height="wrap_content"

@ -73,7 +73,7 @@
app:layout_constraintTop_toTopOf="@+id/tvDownloading"
app:srcCompat="@drawable/baseline_info_24" />
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvBody"
android:layout_width="0dp"
android:layout_height="wrap_content"

@ -334,7 +334,7 @@
app:layout_constraintStart_toEndOf="@id/paddingStart"
app:layout_constraintTop_toBottomOf="@id/tvExpand" />
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvError"
android:layout_width="0dp"
android:layout_height="wrap_content"

@ -14,7 +14,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvHeaders"
android:layout_width="0dp"
android:layout_height="wrap_content"

@ -331,7 +331,7 @@
app:layout_constraintStart_toEndOf="@id/paddingStart"
app:layout_constraintTop_toBottomOf="@id/tvExpand" />
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvError"
android:layout_width="0dp"
android:layout_height="wrap_content"

@ -169,7 +169,6 @@
android:text="@string/title_identity_required"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?attr/colorWarning"
android:textIsSelectable="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/vwColor"
app:layout_constraintTop_toBottomOf="@id/tvQuota" />
@ -183,12 +182,11 @@
android:text="@string/title_drafts_required"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?attr/colorWarning"
android:textIsSelectable="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/vwColor"
app:layout_constraintTop_toBottomOf="@id/tvIdentity" />
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvWarning"
android:layout_width="0dp"
android:layout_height="wrap_content"
@ -202,7 +200,7 @@
app:layout_constraintStart_toEndOf="@id/vwColor"
app:layout_constraintTop_toBottomOf="@id/tvDrafts" />
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvError"
android:layout_width="0dp"
android:layout_height="wrap_content"

@ -223,7 +223,7 @@
app:layout_constraintStart_toEndOf="@id/ibExpander"
app:layout_constraintTop_toBottomOf="@id/tvType" />
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvError"
android:layout_width="0dp"
android:layout_height="wrap_content"

@ -162,7 +162,7 @@
app:layout_constraintStart_toEndOf="@+id/ivState"
app:layout_constraintTop_toBottomOf="@id/tvSignKeyId" />
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvError"
android:layout_width="0dp"
android:layout_height="wrap_content"

@ -13,7 +13,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvData"
android:layout_width="0dp"
android:layout_height="wrap_content"

@ -66,7 +66,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
<eu.faircode.email.FixedTextView
android:id="@+id/tvError"
android:layout_width="0dp"
android:layout_height="wrap_content"

Loading…
Cancel
Save