Cleanup FoldableLinearLayout

This commit is contained in:
Dominik Schürmann
2014-08-27 13:54:33 +02:00
parent 5ddbbb76be
commit 86a05033ae
5 changed files with 9 additions and 18 deletions

View File

@@ -24,7 +24,7 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
@@ -38,9 +38,7 @@ import org.sufficientlysecure.keychain.R;
android:layout_width="wrap_content"
android:layout_height="wrap_content"
custom:foldedLabel="@string/TEXT_TO_DISPLAY_WHEN_FOLDED"
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">
custom:unFoldedLabel="@string/TEXT_TO_DISPLAY_WHEN_UNFOLDED">
<include layout="@layout/ELEMENTS_TO_BE_FOLDED"/>
@@ -49,7 +47,7 @@ import org.sufficientlysecure.keychain.R;
*/
public class FoldableLinearLayout extends LinearLayout {
private ImageButton mFoldableIcon;
private ImageView mFoldableIcon;
private boolean mFolded;
private boolean mHasMigrated = false;
private Integer mShortAnimationDuration = null;
@@ -139,7 +137,7 @@ public class FoldableLinearLayout extends LinearLayout {
}
private void initialiseInnerViews() {
mFoldableIcon = (ImageButton) mFoldableLayout.findViewById(R.id.foldableIcon);
mFoldableIcon = (ImageView) mFoldableLayout.findViewById(R.id.foldableIcon);
mFoldableIcon.setImageResource(R.drawable.ic_action_expand);
mFoldableTextView = (TextView) mFoldableLayout.findViewById(R.id.foldableText);
mFoldableTextView.setText(mFoldedLabel);