[Android] Remove ExpandableLayout

Jean-Baptiste Kempf git at videolan.org
Sat May 23 19:09:07 CEST 2015


vlc-ports/android | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sat May 23 17:57:35 2015 +0200| [115493ad551e2e8737ab15230f1c248b4c486050] | committer: Jean-Baptiste Kempf

Remove ExpandableLayout

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=115493ad551e2e8737ab15230f1c248b4c486050
---

 .../org/videolan/vlc/widget/ExpandableLayout.java  |  111 --------------------
 1 file changed, 111 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/widget/ExpandableLayout.java b/vlc-android/src/org/videolan/vlc/widget/ExpandableLayout.java
deleted file mode 100644
index b8e620e..0000000
--- a/vlc-android/src/org/videolan/vlc/widget/ExpandableLayout.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*****************************************************************************
- * ExpandableLayout.java
- *****************************************************************************
- * Copyright © 2013 VLC authors and VideoLAN
- *
- * This program 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 2 of the License, or
- * (at your option) any later version.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-package org.videolan.vlc.widget;
-
-import org.videolan.vlc.R;
-import org.videolan.vlc.interfaces.OnExpandableListener;
-import org.videolan.vlc.util.Util;
-
-import android.content.Context;
-import android.util.AttributeSet;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.widget.ImageView;
-import android.widget.LinearLayout;
-import android.widget.TextView;
-
-public class ExpandableLayout extends LinearLayout {
-
-    private final View mHeaderLayout;
-    private final ImageView mIcon;
-    private final TextView mTitle;
-    private final TextView mText;
-    private final ImageView mMore;
-    private final LinearLayout mContent;
-    private Boolean mExpanded;
-    private OnExpandableListener listener = null;
-
-    public ExpandableLayout(Context context, AttributeSet attrs) {
-        super(context, attrs);
-
-        LayoutInflater.from(context).inflate(R.layout.expandable_layout, this, true);
-
-        mHeaderLayout = findViewById(R.id.header_layout);
-        mIcon = (ImageView) findViewById(R.id.icon);
-        mTitle = (TextView) findViewById(R.id.title);
-        mText = (TextView) findViewById(R.id.text);
-        mMore = (ImageView) findViewById(R.id.more);
-        mContent = (LinearLayout) findViewById(R.id.content);
-
-        mHeaderLayout.setOnClickListener(new OnClickListener() {
-            @Override
-            public void onClick(View v) {
-                setState(!mExpanded);
-            }
-        });
-
-        setState(isInEditMode());
-    }
-
-    private void setState(Boolean expanded) {
-        mExpanded = expanded;
-        mMore.setImageResource(expanded ?
-                Util.getResourceFromAttribute(getContext(), R.attr.ic_up_style) :
-                    Util.getResourceFromAttribute(getContext(), R.attr.ic_down_style));
-        mContent.setVisibility(expanded ? View.VISIBLE : View.GONE);
-    }
-
-    public void setTitle(int resid) {
-        mTitle.setText(resid);
-    }
-
-    public void setText(String text) {
-        mText.setText(text);
-        mText.setVisibility(text != null ? View.VISIBLE : View.GONE);
-    }
-
-    public void setIcon(int resid) {
-        mIcon.setImageResource(resid);
-        mIcon.setVisibility(View.VISIBLE);
-    }
-
-    public void setContent(Context context, int resid) {
-        View view = LayoutInflater.from(context).inflate(resid, null, true);
-        mContent.addView(view);
-    }
-
-    public void expand() {
-        setState(true);
-    }
-
-    public void collapse() {
-        setState(false);
-    }
-
-    public void dismiss() {
-        if (this.listener != null)
-            this.listener.onDismiss();
-    }
-
-    public void setOnExpandableListener(OnExpandableListener listener) {
-        this.listener = listener;
-    }
-}



More information about the Android mailing list