This repository has been archived by the owner on Jul 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Replace TODOs with tickets in backlog * Add adapter for FitnessDetailsFragment playlist * Add scroll view to settings fragment * Remove skip button in Onboarding permissions * Fix soft lock on selecting fallback playlist * Fix typo
- Loading branch information
1 parent
68dce3f
commit 29c90d9
Showing
15 changed files
with
146 additions
and
90 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
56 changes: 56 additions & 0 deletions
56
app/src/main/java/com/bruno/android/ui/fitnessdetails/FitnessDetailsPlaylistAdapter.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,56 @@ | ||
package com.bruno.android.ui.fitnessdetails; | ||
|
||
import android.view.LayoutInflater; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
|
||
import androidx.annotation.NonNull; | ||
import androidx.recyclerview.widget.RecyclerView; | ||
|
||
import com.bruno.android.R; | ||
import com.bruno.android.music.BrunoTrack; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class FitnessDetailsPlaylistAdapter extends RecyclerView.Adapter<FitnessDetailsPlaylistViewHolder> { | ||
|
||
// MARK: - Private members | ||
|
||
private int[] trackColours; | ||
private List<BrunoTrack> data; | ||
|
||
// MARK: - Lifecycle methods | ||
|
||
public FitnessDetailsPlaylistAdapter(final int[] trackColours) { | ||
this.trackColours = trackColours; | ||
this.data = new ArrayList<>(); | ||
} | ||
|
||
// MARK: - Public methods | ||
|
||
public void setData(final List<BrunoTrack> data) { | ||
this.data = data; | ||
notifyDataSetChanged(); | ||
} | ||
|
||
// MARK: - RecyclerView.ViewHolder methods | ||
|
||
@NonNull | ||
@Override | ||
public FitnessDetailsPlaylistViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { | ||
View viewHolderItemView = LayoutInflater.from(parent.getContext()) | ||
.inflate(R.layout.view_holder_fitness_details_playlist, parent, false); | ||
return new FitnessDetailsPlaylistViewHolder(viewHolderItemView); | ||
} | ||
|
||
@Override | ||
public void onBindViewHolder(@NonNull FitnessDetailsPlaylistViewHolder holder, int position) { | ||
holder.populate(trackColours[position % trackColours.length], data.get(position)); | ||
} | ||
|
||
@Override | ||
public int getItemCount() { | ||
return data.size(); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
app/src/main/java/com/bruno/android/ui/fitnessdetails/FitnessDetailsPlaylistViewHolder.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,37 @@ | ||
package com.bruno.android.ui.fitnessdetails; | ||
|
||
import android.view.View; | ||
import android.widget.ImageView; | ||
import android.widget.TextView; | ||
|
||
import androidx.annotation.NonNull; | ||
import androidx.recyclerview.widget.RecyclerView; | ||
|
||
import com.bruno.android.R; | ||
import com.bruno.android.music.BrunoTrack; | ||
|
||
public class FitnessDetailsPlaylistViewHolder extends RecyclerView.ViewHolder { | ||
|
||
// MARK: - Private members | ||
|
||
private ImageView trackIcon; | ||
private TextView trackName; | ||
private TextView trackArtists; | ||
|
||
// MARK: - Lifecycle methods | ||
|
||
public FitnessDetailsPlaylistViewHolder(@NonNull View itemView) { | ||
super(itemView); | ||
trackIcon = itemView.findViewById(R.id.fitness_details_playlist_track_icon); | ||
trackName = itemView.findViewById(R.id.fitness_details_playlist_track_name); | ||
trackArtists = itemView.findViewById(R.id.fitness_details_playlist_track_artists); | ||
} | ||
|
||
// MARK: - Public methods | ||
|
||
public void populate(int musicNoteColour, final BrunoTrack track) { | ||
trackIcon.setColorFilter(musicNoteColour); | ||
trackName.setText(track.getName()); | ||
trackArtists.setText(track.getArtists()); | ||
} | ||
} |
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
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
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
Oops, something went wrong.