mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-05 08:45:08 -05:00
Cleanup FoldableLinearLayout
This commit is contained in:
parent
5ddbbb76be
commit
86a05033ae
@ -24,7 +24,7 @@ import android.view.LayoutInflater;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.animation.AlphaAnimation;
|
import android.view.animation.AlphaAnimation;
|
||||||
import android.view.animation.Animation;
|
import android.view.animation.Animation;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
@ -38,9 +38,7 @@ import org.sufficientlysecure.keychain.R;
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
custom:foldedLabel="@string/TEXT_TO_DISPLAY_WHEN_FOLDED"
|
custom:foldedLabel="@string/TEXT_TO_DISPLAY_WHEN_FOLDED"
|
||||||
custom:unFoldedLabel="@string/TEXT_TO_DISPLAY_WHEN_UNFOLDED"
|
custom:unFoldedLabel="@string/TEXT_TO_DISPLAY_WHEN_UNFOLDED">
|
||||||
custom:foldedIcon="ICON_NAME_FROM_FontAwesomeText_TO_USE_WHEN_FOLDED"
|
|
||||||
custom:unFoldedIcon="ICON_NAME_FROM_FontAwesomeText_TO_USE_WHEN_UNFOLDED">
|
|
||||||
|
|
||||||
<include layout="@layout/ELEMENTS_TO_BE_FOLDED"/>
|
<include layout="@layout/ELEMENTS_TO_BE_FOLDED"/>
|
||||||
|
|
||||||
@ -49,7 +47,7 @@ import org.sufficientlysecure.keychain.R;
|
|||||||
*/
|
*/
|
||||||
public class FoldableLinearLayout extends LinearLayout {
|
public class FoldableLinearLayout extends LinearLayout {
|
||||||
|
|
||||||
private ImageButton mFoldableIcon;
|
private ImageView mFoldableIcon;
|
||||||
private boolean mFolded;
|
private boolean mFolded;
|
||||||
private boolean mHasMigrated = false;
|
private boolean mHasMigrated = false;
|
||||||
private Integer mShortAnimationDuration = null;
|
private Integer mShortAnimationDuration = null;
|
||||||
@ -139,7 +137,7 @@ public class FoldableLinearLayout extends LinearLayout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void initialiseInnerViews() {
|
private void initialiseInnerViews() {
|
||||||
mFoldableIcon = (ImageButton) mFoldableLayout.findViewById(R.id.foldableIcon);
|
mFoldableIcon = (ImageView) mFoldableLayout.findViewById(R.id.foldableIcon);
|
||||||
mFoldableIcon.setImageResource(R.drawable.ic_action_expand);
|
mFoldableIcon.setImageResource(R.drawable.ic_action_expand);
|
||||||
mFoldableTextView = (TextView) mFoldableLayout.findViewById(R.id.foldableText);
|
mFoldableTextView = (TextView) mFoldableLayout.findViewById(R.id.foldableText);
|
||||||
mFoldableTextView.setText(mFoldedLabel);
|
mFoldableTextView.setText(mFoldedLabel);
|
||||||
|
@ -59,9 +59,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
custom:foldedLabel="@string/api_settings_show_advanced"
|
custom:foldedLabel="@string/api_settings_show_advanced"
|
||||||
custom:unFoldedLabel="@string/api_settings_hide_advanced"
|
custom:unFoldedLabel="@string/api_settings_hide_advanced">
|
||||||
custom:foldedIcon="fa-chevron-right"
|
|
||||||
custom:unFoldedIcon="fa-chevron-down">
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -40,9 +40,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
custom:foldedLabel="@string/api_settings_show_info"
|
custom:foldedLabel="@string/api_settings_show_info"
|
||||||
custom:unFoldedLabel="@string/api_settings_hide_info"
|
custom:unFoldedLabel="@string/api_settings_hide_info">
|
||||||
custom:foldedIcon="fa-chevron-right"
|
|
||||||
custom:unFoldedIcon="fa-chevron-down">
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -67,7 +65,7 @@
|
|||||||
android:id="@+id/api_app_settings_package_signature"
|
android:id="@+id/api_app_settings_package_signature"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="Base64 encoded signature"
|
android:text="Base64 encoded hash of signature"
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall" />
|
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||||
|
|
||||||
</org.sufficientlysecure.keychain.ui.widget.FoldableLinearLayout>
|
</org.sufficientlysecure.keychain.ui.widget.FoldableLinearLayout>
|
||||||
|
@ -11,14 +11,13 @@
|
|||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:clickable="true">
|
android:clickable="true">
|
||||||
|
|
||||||
<ImageButton
|
<ImageView
|
||||||
android:id="@+id/foldableIcon"
|
android:id="@+id/foldableIcon"
|
||||||
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:layout_gravity="center_vertical"
|
||||||
android:layout_marginRight="10dp"
|
android:layout_marginRight="10dp"
|
||||||
android:src="@drawable/ic_action_expand"
|
android:src="@drawable/ic_action_expand"/>
|
||||||
android:background="@drawable/button_no_style"/>
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/foldableText"
|
android:id="@+id/foldableText"
|
||||||
|
@ -4,8 +4,6 @@
|
|||||||
<declare-styleable name="FoldableLinearLayout">
|
<declare-styleable name="FoldableLinearLayout">
|
||||||
<attr name="foldedLabel" format="string" />
|
<attr name="foldedLabel" format="string" />
|
||||||
<attr name="unFoldedLabel" format="string" />
|
<attr name="unFoldedLabel" format="string" />
|
||||||
<attr name="foldedIcon" format="string" />
|
|
||||||
<attr name="unFoldedIcon" format="string" />
|
|
||||||
</declare-styleable>
|
</declare-styleable>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
Loading…
Reference in New Issue
Block a user