-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Java 1.8 is buggy, removing implementations
- Loading branch information
Showing
8 changed files
with
135 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
app/src/main/java/news/androidtv/tvapprepo/presenters/LauncherActivitiesPresenter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package news.androidtv.tvapprepo.presenters; | ||
|
||
import android.support.v17.leanback.widget.ImageCardView; | ||
import android.support.v17.leanback.widget.Presenter; | ||
import android.view.ContextThemeWrapper; | ||
import android.view.ViewGroup; | ||
import android.widget.ImageView; | ||
|
||
import java.io.File; | ||
|
||
import news.androidtv.tvapprepo.R; | ||
|
||
/** | ||
* A presenter which can be used to show downloaded APKs with an optional title along the bottom. | ||
* | ||
* @author Nick | ||
* @version 2017.01.12 | ||
*/ | ||
public class LauncherActivitiesPresenter extends CardPresenter { | ||
private ContextThemeWrapper contextThemeWrapper; | ||
|
||
@Override | ||
public ViewHolder onCreateViewHolder(ViewGroup parent) { | ||
if (contextThemeWrapper == null) { | ||
contextThemeWrapper = new ContextThemeWrapper(parent.getContext(), | ||
R.style.OptionsImageCardViewStyle); | ||
} | ||
ImageCardView cardView = new ImageCardView(contextThemeWrapper); | ||
cardView.setFocusable(true); | ||
cardView.setFocusableInTouchMode(true); | ||
cardView.setBackgroundColor(parent.getResources().getColor(R.color.primaryDark)); | ||
return new ViewHolder(cardView); | ||
} | ||
|
||
@Override | ||
public void onBindViewHolder(Presenter.ViewHolder viewHolder, Object item) { | ||
final File downloadedApk = (File) item; | ||
final ImageCardView cardView = (ImageCardView) viewHolder.view; | ||
cardView.setMainImage(contextThemeWrapper.getDrawable(R.drawable.download)); | ||
cardView.setTitleText(downloadedApk.getName()); | ||
cardView.setMainImageDimensions(CARD_WIDTH, CARD_HEIGHT); | ||
cardView.getMainImageView().setScaleType(ImageView.ScaleType.FIT_CENTER); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Wed Sep 21 00:24:52 EDT 2016 | ||
#Thu Jan 12 18:08:02 EST 2017 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-3.2-all.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters