Skip to content
This repository has been archived by the owner on Jul 7, 2020. It is now read-only.

Commit

Permalink
Develop (#15)
Browse files Browse the repository at this point in the history
* update build version

* Fixes (#14)

- Añadido cacheo de imágenes
- Muchos cambios visuales en la lista
- Cambiada la lista por RecyclerView, con sus correspondientes animaciones al buscar
- Solucionado un fallo al filtrar
- Refactor de código

* update settings screen

* update exoplayer and gson

* revert settings xml

* update app version
  • Loading branch information
LaQuay authored Dec 14, 2019
1 parent 4205b67 commit e7bb344
Show file tree
Hide file tree
Showing 17 changed files with 397 additions and 357 deletions.
116 changes: 116 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ buildscript {

repositories {
google()
mavenCentral()
jcenter()
}
dependencies {
Expand All @@ -17,6 +18,7 @@ buildscript {
allprojects {
repositories {
google()
mavenCentral()
jcenter()
}
}
Expand Down
17 changes: 11 additions & 6 deletions mobile/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 28
compileSdkVersion 29
defaultConfig {
applicationId "laquay.com.canalestdt"
minSdkVersion 19
targetSdkVersion 28
versionCode 8
versionName "0.5.4"
targetSdkVersion 29
versionCode 9
versionName "0.5.5"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand All @@ -24,6 +24,7 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.android.support:recyclerview-v7:29.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
Expand All @@ -32,6 +33,10 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

implementation 'com.android.volley:volley:1.1.1'
implementation 'com.google.android.exoplayer:exoplayer:2.10.4'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.google.android.exoplayer:exoplayer:2.11.0'
implementation 'com.google.code.gson:gson:2.8.6'

implementation 'com.github.bumptech.glide:glide:4.10.0'
implementation 'com.github.bumptech.glide:volley-integration:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.10.0'
}
2 changes: 2 additions & 0 deletions mobile/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
-keep public class * extends com.bumptech.glide.module.AppGlideModule
-keep class com.bumptech.glide.GeneratedAppGlideModuleImpl
81 changes: 81 additions & 0 deletions mobile/src/main/java/laquay/com/canalestdt/ChannelListAdapter.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
package laquay.com.canalestdt;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.DiffUtil;
import androidx.recyclerview.widget.ListAdapter;
import androidx.recyclerview.widget.RecyclerView;

import com.bumptech.glide.Glide;

import laquay.com.canalestdt.component.ChannelList;

public class ChannelListAdapter extends ListAdapter<ChannelList, ChannelListAdapter.ViewHolder> {

private Context context;
private OnItemClickListener listener;

public ChannelListAdapter(Context context, OnItemClickListener listener) {
super(new DiffUtil.ItemCallback<ChannelList>() {
@Override
public boolean areItemsTheSame(@NonNull ChannelList oldItem, @NonNull ChannelList newItem) {
return oldItem.getChannel().getName().equals(newItem.getChannel().getName());
}

@Override
public boolean areContentsTheSame(@NonNull ChannelList oldItem, @NonNull ChannelList newItem) {
return true;
}
});
this.context = context;
this.listener = listener;
}

@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return new ViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_list_channels, parent, false));
}

@Override
public void onBindViewHolder(@NonNull ViewHolder holder, final int position) {
final ChannelList channel = getItem(position);

holder.titleView.setText(channel.getChannel().getName());
holder.subtitleView.setText(String.format("%s - %s", channel.getCountryName(), channel.getCommunityName()));

// Temporary fix
String imageUrl = channel.getChannel().getLogo().replace("http://graph.facebook.com", "https://graph.facebook.com");
Glide.with(context).load(imageUrl).placeholder(R.mipmap.ic_launcher).fallback(R.mipmap.ic_launcher).into(holder.imageView);

holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
listener.onItemClickListener(channel);
}
});
}

public class ViewHolder extends RecyclerView.ViewHolder {
ImageView imageView;
TextView titleView;
TextView subtitleView;

public ViewHolder(@NonNull View itemView) {
super(itemView);
this.imageView = itemView.findViewById(R.id.channel_icon);
this.titleView = itemView.findViewById(R.id.channel_title);
this.subtitleView = itemView.findViewById(R.id.channel_description);
}
}

interface OnItemClickListener {
void onItemClickListener(ChannelList channelList);
}
}
Loading

0 comments on commit e7bb344

Please sign in to comment.