[Android] Remove dead code

Geoffrey Métais git at videolan.org
Tue Feb 9 17:22:01 CET 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Feb  9 17:15:55 2016 +0100| [8183707d307c88a3291d4c67356f42fc8d5cdd63] | committer: Geoffrey Métais

Remove dead code

> https://code.videolan.org/videolan/vlc-android/commit/8183707d307c88a3291d4c67356f42fc8d5cdd63
---

 .../org/videolan/vlc/gui/tv/StringPresenter.java   |  57 --------
 .../src/org/videolan/vlc/gui/tv/TvMedia.java       | 156 ---------------------
 2 files changed, 213 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/StringPresenter.java b/vlc-android/src/org/videolan/vlc/gui/tv/StringPresenter.java
deleted file mode 100644
index ff07f68..0000000
--- a/vlc-android/src/org/videolan/vlc/gui/tv/StringPresenter.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*****************************************************************************
- * StringPresenter.java
- *****************************************************************************
- * Copyright © 2014-2015 VLC authors, VideoLAN and VideoLabs
- * Author: Geoffrey Métais
- *
- * 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.gui.tv;
-
-import org.videolan.vlc.R;
-
-import android.content.res.Resources;
-import android.support.v17.leanback.widget.Presenter;
-import android.view.ViewGroup;
-import android.widget.TextView;
-
-public class StringPresenter extends Presenter {
-    private static final String TAG = "StringPresenter";
-
-    public ViewHolder onCreateViewHolder(ViewGroup parent) {
-        TextView textView = new TextView(parent.getContext());
-        textView.setFocusable(true);
-        textView.setFocusableInTouchMode(true);
-        textView.setBackground(
-                parent.getContext().getResources().getDrawable(R.drawable.background_cone));
-        return new ViewHolder(textView);
-    }
-
-    public void onBindViewHolder(ViewHolder viewHolder, Object item) {
-        Resources res = viewHolder.view.getContext().getResources();
-        TextView tv = (TextView) viewHolder.view;
-        tv.setText(item.toString());
-        if (res.getString(R.string.preferences).equals(item.toString())) {
-            tv.setBackground(res.getDrawable(R.drawable.ic_menu_preferences_big));
-        }
-        tv.setHeight(res.getDimensionPixelSize(R.dimen.grid_card_thumb_height));
-        tv.setWidth(res.getDimensionPixelSize(R.dimen.grid_card_thumb_width));
-    }
-
-    public void onUnbindViewHolder(ViewHolder viewHolder) {
-        // no op
-    }
-
-}
diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/TvMedia.java b/vlc-android/src/org/videolan/vlc/gui/tv/TvMedia.java
deleted file mode 100644
index 2244a86..0000000
--- a/vlc-android/src/org/videolan/vlc/gui/tv/TvMedia.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*****************************************************************************
- * TvMedia.java
- *****************************************************************************
- * Copyright © 2014-2015 VLC authors, VideoLAN and VideoLabs
- * Author: Geoffrey Métais
- *
- * 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.gui.tv;
-
-import android.os.Parcel;
-import android.os.Parcelable;
-
-public class TvMedia implements Parcelable {
-    private long id;
-    private String mediaUrl;
-    private String title;
-    private String description;
-    private int bgImageId;
-    private int cardImageId;
-    private String bgImageUrl;
-    private String cardImageUrl;
-
-    public TvMedia(long id, String title, String description, String bgImageUrl, String cardImageUrl, String mediaUrl) {
-        this.id = id;
-        this.title = title;
-        this.description = description;
-        this.bgImageUrl = bgImageUrl;
-        this.cardImageUrl = cardImageUrl;
-        this.mediaUrl = mediaUrl;
-    }
-
-    public TvMedia(long id, String title, String description, int bgImageId, int cardImageId, String mediaUrl) {
-        this.id = id;
-        this.title = title;
-        this.description = description;
-        this.bgImageId = bgImageId;
-        this.cardImageId = cardImageId;
-        this.mediaUrl = mediaUrl;
-    }
-
-    public long getId(){
-        return id;
-    }
-
-    public String getDescription(){
-        return description;
-    }
-
-    public String getBgImageUrl(){
-        return bgImageUrl;
-    }
-
-    public String getCardImageUrl(){
-        return cardImageUrl;
-    }
-
-    public String getVideoUrl(){
-        return mediaUrl;
-    }
-
-    public String getTitle(){
-        return title;
-    }
-
-    public int getBackgroundImageId() {
-        return bgImageId;
-    }
-
-//    public URI getBackgroundImageURI() {
-//        try {
-//            Log.d("BACK MEDIA: ", bgImageUrl);
-//            return new URI(getBgImageUrl());
-//        } catch (URISyntaxException e) {
-//            Log.d("URI exception: ", bgImageUrl);
-//            return null;
-//        }
-//    }
-
-    public int getCardImageId() {
-        return cardImageId;
-    }
-
-//    public URI getCardImageURI() {
-//        try {
-//            return new URI(getCardImageUrl());
-//        } catch (URISyntaxException e) {
-//            return null;
-//        }
-//    }
-
-    @Override
-    public String toString() {
-        return "Movie{" +
-                "id=" + id +
-                ", title='" + title + '\'' +
-                ", mediaUrl='" + mediaUrl + '\'' +
-                ", backgroundImageId='" + bgImageId + '\'' +
-//                ", backgroundImageURI='" + getBackgroundImageURI().toString() + '\'' +
-                ", cardImageUrl='" + cardImageUrl + '\'' +
-                '}';
-    }
-
-    @Override
-    public int describeContents() {
-        // TODO Auto-generated method stub
-        return 0;
-    }
-
-    @Override
-    public void writeToParcel(Parcel dest, int flags) {
-        dest.writeLong(id);
-        dest.writeString(mediaUrl);
-        dest.writeString(title);
-        dest.writeString(description);
-        dest.writeInt(bgImageId);
-        dest.writeInt(cardImageId);
-        dest.writeString(bgImageUrl);
-        dest.writeString(cardImageUrl);
-    }
-
-    public static final Parcelable.Creator<TvMedia> CREATOR
-            = new Parcelable.Creator<TvMedia>() {
-        public TvMedia createFromParcel(Parcel in) {
-            return new TvMedia(in);
-        }
-
-        public TvMedia[] newArray(int size) {
-            return new TvMedia[size];
-        }
-    };
-
-    private TvMedia(Parcel in) {
-        id = in.readLong();
-        mediaUrl = in.readString();
-        title = in.readString();
-        description = in.readString();
-        bgImageId = in.readInt();
-        cardImageId = in.readInt();
-        bgImageUrl = in.readString();
-        cardImageUrl = in.readString();
-    }
-
-}



More information about the Android mailing list