From a27ef26800220764f9cee13ac395186568ac1955 Mon Sep 17 00:00:00 2001 From: yutou Date: Wed, 2 Dec 2020 18:34:06 +0800 Subject: [PATCH] update --- app/build.gradle | 3 +- app/src/main/AndroidManifest.xml | 4 + .../Adapters/AlbumsRecyclerAdapter.java | 118 ++++++++++++++++++ .../Adapters/MusicLibsAdapter.java | 52 +++++--- .../nas_music_player/Datas/MusicData.java | 47 ++++--- .../containers/MusicContainer.java | 57 +++++++-- .../nas_music_player/tools/NetworkTool.java | 46 ++++--- .../nas_music_player/tools/SQLiteManager.java | 2 +- .../views/AlbumsActivity.java | 70 +++++++++++ .../views/Fragments/MusicLibsFragment.java | 28 ++++- app/src/main/res/layout/activity_album.xml | 53 ++++++++ .../res/layout/layout_music_libs_item.xml | 1 - 12 files changed, 417 insertions(+), 64 deletions(-) create mode 100644 app/src/main/java/com/yutou/nas_music_player/Adapters/AlbumsRecyclerAdapter.java create mode 100644 app/src/main/java/com/yutou/nas_music_player/views/AlbumsActivity.java create mode 100644 app/src/main/res/layout/activity_album.xml diff --git a/app/build.gradle b/app/build.gradle index ac06344..a65c0f4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -45,6 +45,7 @@ android { } dependencies { + implementation 'com.google.android.material:material:1.2.1' def room_version = "2.2.5" implementation fileTree(dir: "libs", include: ["*.jar"]) implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" @@ -65,7 +66,7 @@ dependencies { implementation 'androidx.palette:palette:1.0.0' implementation 'com.github.zrunker:ZTextView:v1.0.2' - debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.5' + //debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.5' implementation 'com.kaopiz:kprogresshud:1.2.0' implementation 'com.ogaclejapan.smarttablayout:library:2.0.0@aar' implementation 'com.ogaclejapan.smarttablayout:utils-v4:2.0.0@aar' diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index b030d9d..9d23041 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -30,6 +30,10 @@ android:name=".views.PlayLibsActivity" android:fitsSystemWindows="true" android:theme="@style/Theme.AppCompat.DayNight.NoActionBar" /> + { + List list; + Context context; + + public AlbumsRecyclerAdapter(Context context, List list) { + this.list = list; + this.context = context; + } + + @NonNull + @Override + public AlbumHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + return new AlbumHolder(LayoutInflater.from(context).inflate(R.layout.layout_music_libs_item, parent, false)); + } + + @SuppressLint("SetTextI18n") + @Override + public void onBindViewHolder(@NonNull AlbumHolder holder, int position) { + MusicData data = list.get(position); + holder.title.setText(data.getTitle()); + holder.artist.setText(data.getArtist()); + holder.icon.setImageResource(R.drawable.ic_dir); + if (!data.isDir()) { + holder.message.setText(data.getBitRate() + "kbps | " + data.getSampleRate() + "hz | " + data.getEncodingType()); + holder.message.setVisibility(View.VISIBLE); + holder.artist.setVisibility(View.VISIBLE); + // holder.icon.setImageBitmap(ThumbnailUtils.extractThumbnail(data.getImg(), 64,64)); + Glide.with(context).load(data.getImg(-1, -1)) + .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(25, 3))) + .into(holder.icon); + holder.icon.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + System.out.println(data.getFile()); + System.out.println(data.getImageUrl()); + System.out.println(data.getImg(-1, -1)); + if (data.getImg(-1, -1) != null) { + Glide.with(context).load(data.getImg(-1, -1)) + .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(25, 3))) + .into(holder.icon); + } + } + }); + } else { + holder.message.setText(""); + holder.play_mask.setVisibility(View.GONE); + holder.icon.setImageResource(R.drawable.ic_dir); + } + holder.top.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + MusicContainer.getInstance().addTmpList(data); + Toast.makeText(context, "已添加到队列中", Toast.LENGTH_LONG).show(); + for (MusicData musicData : MusicContainer.getInstance().getTmpPlayList()) { + System.out.println("临时队列:" + musicData.getTitle()); + } + } + + }); + } + + @Override + public int getItemCount() { + return list.size(); + } + + public static class AlbumHolder extends RecyclerView.ViewHolder { + MarqueeTextView title, artist, message; + LinearLayout buttons; + ImageButton collection, top, dislike; + ImageView icon, play_mask; + + public AlbumHolder(@NonNull View itemView) { + super(itemView); + title = itemView.findViewById(R.id.title); + artist = itemView.findViewById(R.id.artist); + message = itemView.findViewById(R.id.message); + buttons = itemView.findViewById(R.id.buttons); + collection = itemView.findViewById(R.id.collection); + top = itemView.findViewById(R.id.top); + dislike = itemView.findViewById(R.id.dislike); + icon = itemView.findViewById(R.id.album_image); + play_mask = itemView.findViewById(R.id.play_mask); + } + } +} diff --git a/app/src/main/java/com/yutou/nas_music_player/Adapters/MusicLibsAdapter.java b/app/src/main/java/com/yutou/nas_music_player/Adapters/MusicLibsAdapter.java index 2916043..9ce3c7d 100644 --- a/app/src/main/java/com/yutou/nas_music_player/Adapters/MusicLibsAdapter.java +++ b/app/src/main/java/com/yutou/nas_music_player/Adapters/MusicLibsAdapter.java @@ -75,25 +75,29 @@ public class MusicLibsAdapter extends ArrayAdapter { Map> map; switch (model) { case LIBS_MODEL_Album: - map = MusicContainer.getInstance().getAllAlbumMapList(); - for (String title : map.keySet()) { - MusicData data = new MusicData(); - data.setTitle(title); - data.setAlbum(map.get(title).get(0).getAlbum()); - data.setFile(map.get(title).get(0).getFile()); - data.setArtist(""); - list.add(data); - } + new Thread(new Runnable() { + @Override + public void run() { + String album=null; + MusicContainer.getLibs().onAlbumMusicData(album, new NetworkInterface() { + @Override + public void httpGetData(Object data, int state) { + list.clear(); + if (data != null && state == 0) + list.addAll((List) data); + notifyDataSetChanged(); + } + + @Override + public void httpError(Exception e) { + + } + }); + } + }).start(); break; case LIBS_MODEL_Artist: - map = MusicContainer.getInstance().getAllArtistMapList(); - for (String title : map.keySet()) { - MusicData data = new MusicData(); - data.setTitle(title); - data.setFile(map.get(title).get(0).getFile()); - data.setArtist(map.get(title).get(0).getArtist()); - list.add(data); - } + break; case LIBS_MODEL_Tmp: list.addAll(MusicContainer.getInstance().getTmpPlayList()); @@ -122,7 +126,13 @@ public class MusicLibsAdapter extends ArrayAdapter { list.clear(); if (data != null && state == 0) list.addAll((List) data); + AppData.handler.post(new Runnable() { + @Override + public void run() { notifyDataSetChanged(); + + } + }); } @Override @@ -320,7 +330,13 @@ public class MusicLibsAdapter extends ArrayAdapter { this.musicPath = path; } - static class ViewHolder extends RecyclerView.ViewHolder { + public int getModel() { + return model; + } + + + + public static class ViewHolder extends RecyclerView.ViewHolder { MarqueeTextView title, artist, message; LinearLayout buttons; ImageButton collection, top, dislike; diff --git a/app/src/main/java/com/yutou/nas_music_player/Datas/MusicData.java b/app/src/main/java/com/yutou/nas_music_player/Datas/MusicData.java index 75a533b..fb010ce 100644 --- a/app/src/main/java/com/yutou/nas_music_player/Datas/MusicData.java +++ b/app/src/main/java/com/yutou/nas_music_player/Datas/MusicData.java @@ -27,32 +27,34 @@ import androidx.room.PrimaryKey; public class MusicData { @PrimaryKey(autoGenerate = true) private int id; - @ColumnInfo(name="artist") + @ColumnInfo(name = "artist") private String artist;//艺术家 - @ColumnInfo(name="album") + @ColumnInfo(name = "album") private String album;//专辑 - @ColumnInfo(name="title") + @ColumnInfo(name = "title") private String title;//标题 - @ColumnInfo(name="comment") + @ColumnInfo(name = "comment") private String comment;//评论 - @ColumnInfo(name="year") + @ColumnInfo(name = "year") private String year;//年份 - @ColumnInfo(name="track") + @ColumnInfo(name = "track") private String track;//音轨号 - @ColumnInfo(name="disc_no") + @ColumnInfo(name = "disc_no") private String disc_no;//碟片编号 - @ColumnInfo(name="composer") + @ColumnInfo(name = "composer") private String composer;//作曲 - @ColumnInfo(name="artist_sort") + @ColumnInfo(name = "artist_sort") private String artist_sort;//分类 - @ColumnInfo(name="lastDir") + @ColumnInfo(name = "lastDir") private String lastDir;//上一个文件夹 - @ColumnInfo(name="file") + @ColumnInfo(name = "file") private String file; - @ColumnInfo(name="isDir") + @ColumnInfo(name = "isDir") private boolean isDir = false; @Ignore private Bitmap img; + @Ignore + private boolean isDownloadImg = false; @ColumnInfo private int bitRate;//比特率 @@ -108,6 +110,14 @@ public class MusicData { this.comment = comment; } + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + public String getYear() { if (StringUtil.isEmpty(year)) { year = "8888"; @@ -183,6 +193,8 @@ public class MusicData { } public String getFileBase64() { + if (StringUtil.isEmpty(file)) + return null; return new String(Base64.encode(file.getBytes(), Base64.DEFAULT)).replace("\n", ""); } @@ -191,7 +203,6 @@ public class MusicData { + "?random=false&token=" + NetworkTool.NetworkAPI.HTTP_KEY + "&filePath=" + getFileBase64(); } - private boolean isDownloadImg = false; public String getImageUrl() { return NetworkTool.NetworkAPI.MUSIC_IMAGE + "?fileName=" + getFileBase64(); @@ -213,12 +224,16 @@ public class MusicData { return img; } if (networkInterface != null) - networkInterface.httpGetData(ThumbnailUtils.extractThumbnail(img, width, height), width+height); + networkInterface.httpGetData(ThumbnailUtils.extractThumbnail(img, width, height), width + height); return ThumbnailUtils.extractThumbnail(img, width, height); } if (isDownloadImg) { return null; } + if (StringUtil.isEmpty(file)) { + img = BitmapFactory.decodeResource(MyApplication.application.getResources(), R.mipmap.ic_launcher); + return img; + } img = AppTools.getSaveBitmap(getFileBase64()); if (img != null) { if (width == -1 && height == -1) { @@ -227,7 +242,7 @@ public class MusicData { return img; } if (networkInterface != null) - networkInterface.httpGetData(ThumbnailUtils.extractThumbnail(img, width, height), width+height); + networkInterface.httpGetData(ThumbnailUtils.extractThumbnail(img, width, height), width + height); return ThumbnailUtils.extractThumbnail(img, width, height); } img = null; @@ -250,7 +265,7 @@ public class MusicData { if (width == -1 && height == -1) { networkInterface.httpGetData(img, 0); } else - networkInterface.httpGetData(ThumbnailUtils.extractThumbnail(img, width, height), width+height); + networkInterface.httpGetData(ThumbnailUtils.extractThumbnail(img, width, height), width + height); } }); } diff --git a/app/src/main/java/com/yutou/nas_music_player/containers/MusicContainer.java b/app/src/main/java/com/yutou/nas_music_player/containers/MusicContainer.java index abd45a6..8bdd461 100644 --- a/app/src/main/java/com/yutou/nas_music_player/containers/MusicContainer.java +++ b/app/src/main/java/com/yutou/nas_music_player/containers/MusicContainer.java @@ -462,7 +462,10 @@ public class MusicContainer { } private void initData() { - NetworkTool.init().httpGet(NetworkTool.NetworkAPI.MUSIC_ALL, new JSONObject(), new NetworkInterface() { + if (initInterface != null) + initInterface.init(); + initInterface = null; + /*NetworkTool.init().httpGet(NetworkTool.NetworkAPI.MUSIC_ALL, new JSONObject(), new NetworkInterface() { @Override public void httpGetData(Object data, int state) { JSONObject json = JSONObject.parseObject(data.toString()); @@ -486,6 +489,42 @@ public class MusicContainer { @Override public void httpError(Exception e) { + } + });*/ + } + + public void onAlbumMusicData(String album, NetworkInterface networkInterface) { + JSONObject json = new JSONObject(); + if (StringUtil.isEmpty(album)) { + json.put("album", ""); + } else { + json.put("album", album); + } + NetworkTool.init().httpGet(NetworkTool.NetworkAPI.MUSIC_Album, json, new NetworkInterface() { + @Override + public void httpGetData(Object data, int state) { + JSONObject json = JSONObject.parseObject((String) data); + if (json.getInteger("code") == 0) { + try { + networkInterface.httpGetData(JSONArray.parseArray(json.getJSONArray("data").toJSONString(), MusicData.class), 0); + } catch (Exception e) { + List list=new ArrayList<>(); + for (Object album : json.getJSONArray("data")) { + MusicData musicData=new MusicData(); + musicData.setTitle((String) album); + musicData.setAlbum((String) album); + list.add(musicData); + } + networkInterface.httpGetData(list,0); + } + } else { + networkInterface.httpGetData(new ArrayList<>(), 0); + } + } + + @Override + public void httpError(Exception e) { + } }); } @@ -495,17 +534,11 @@ public class MusicContainer { @Override public void httpGetData(Object data, int state) { JSONObject json = JSONObject.parseObject((String) data); - AppData.handler.post(new Runnable() { - @Override - public void run() { - if (json.getInteger("code") == 0) { - networkInterface.httpGetData(JSONArray.parseArray(json.getString("data"), MusicData.class), 0); - } else { - networkInterface.httpGetData(new ArrayList<>(), 0); - } - } - }); - + if (json.getInteger("code") == 0) { + networkInterface.httpGetData(JSONArray.parseArray(json.getString("data"), MusicData.class), 0); + } else { + networkInterface.httpGetData(new ArrayList<>(), 0); + } } @Override diff --git a/app/src/main/java/com/yutou/nas_music_player/tools/NetworkTool.java b/app/src/main/java/com/yutou/nas_music_player/tools/NetworkTool.java index af69ae2..8754121 100644 --- a/app/src/main/java/com/yutou/nas_music_player/tools/NetworkTool.java +++ b/app/src/main/java/com/yutou/nas_music_player/tools/NetworkTool.java @@ -36,6 +36,7 @@ public class NetworkTool { public static final String HTTP_KEY = "PlVodzYhvxRQbOHKakpKs2dvnoc43Cnk"; public static String HOME = ""; public static String MUSIC_LIST = HOME + "/music/list.do"; + public static String MUSIC_Album = HOME + "/music/getAlbum.do"; public static String MUSIC_ALL = HOME + "/music/all.do"; public static String MUSIC_METADATA = HOME + "/music/find/file.do"; public static String MUSIC_IMAGE = HOME + "/music/image.do"; @@ -51,8 +52,9 @@ public class NetworkTool { public static String donwloadPath = AppData.dir + AppData.download_dir + File.separator; private NetworkTool() { + HOME = "http://192.168.137.1:8000/nas"; if (StringUtil.isEmpty(HOME)) { - httpGet("http://tools.yutou233.cn/nas/music/getlocalhost.do" , new JSONObject(), new NetworkInterface() { + httpGet("http://tools.yutou233.cn/nas/music/getlocalhost.do", new JSONObject(), new NetworkInterface() { @Override public void httpGetData(Object data, int state) { try { @@ -81,17 +83,17 @@ public class NetworkTool { } public void httpGet(final String url, final JSONObject body, final NetworkInterface networkInterface) { - if(!url.startsWith("http:")&&!StringUtil.isEmpty(HOME)){ - httpGet(HOME+url,body,networkInterface); + if (!url.startsWith("http:") && !StringUtil.isEmpty(HOME)) { + httpGet(HOME + url, body, networkInterface); return; } - if(StringUtil.isEmpty(HOME)&&!url.contains("getlocalhost.do")){ + if (StringUtil.isEmpty(HOME) && !url.contains("getlocalhost.do")) { AppData.handler.postDelayed(new Runnable() { @Override public void run() { NetworkTool.init().httpGet(url, body, networkInterface); } - },300); + }, 300); return; } new Thread(new Runnable() { @@ -102,8 +104,8 @@ public class NetworkTool { HttpURLConnection connection = (HttpURLConnection) new URL(url + "?" + toGetSplice(body)).openConnection(); BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); connection.connect(); - if(connection.getResponseCode()!=200){ - networkInterface.httpError(new RuntimeException("http code to :"+connection.getResponseCode())); + if (connection.getResponseCode() != 200) { + networkInterface.httpError(new RuntimeException("http code to :" + connection.getResponseCode())); return; } String tmp; @@ -112,13 +114,29 @@ public class NetworkTool { str.append(tmp); } reader.close(); - if (networkInterface != null) - networkInterface.httpGetData(str.toString(), connection.getResponseCode()); + AppData.handler.post(new Runnable() { + @Override + public void run() { + if (networkInterface != null) { + try { + networkInterface.httpGetData(str.toString(), connection.getResponseCode()); + } catch (IOException e) { + e.printStackTrace(); + } + } + + } + }); //Log.i(TAG + "[" + url + "]", "body:" + str + " (" + connection.getResponseCode() + ")"); } catch (Exception e) { e.printStackTrace(); - if (networkInterface != null) - networkInterface.httpError(e); + AppData.handler.post(new Runnable() { + @Override + public void run() { + if (networkInterface != null) + networkInterface.httpError(e); + } + }); Log.e(TAG, url + " body =" + body.toJSONString()); } } @@ -200,8 +218,8 @@ public class NetworkTool { } public String toGetSplice(JSONObject json) { - try { - json.put("token",NetworkAPI.HTTP_KEY); + try { + json.put("token", NetworkAPI.HTTP_KEY); } catch (JSONException e) { e.printStackTrace(); } @@ -209,7 +227,7 @@ public class NetworkTool { Set keys = json.keySet(); for (String key : keys) { try { - string.append("&").append(key).append("=").append(URLEncoder.encode(json.getString(key),"UTF-8")); + string.append("&").append(key).append("=").append(URLEncoder.encode(json.getString(key), "UTF-8")); } catch (Exception e) { e.printStackTrace(); try { diff --git a/app/src/main/java/com/yutou/nas_music_player/tools/SQLiteManager.java b/app/src/main/java/com/yutou/nas_music_player/tools/SQLiteManager.java index 886eeb9..9237fb8 100644 --- a/app/src/main/java/com/yutou/nas_music_player/tools/SQLiteManager.java +++ b/app/src/main/java/com/yutou/nas_music_player/tools/SQLiteManager.java @@ -9,7 +9,7 @@ import androidx.sqlite.db.SupportSQLiteOpenHelper; import com.yutou.nas_music_player.Datas.MusicData; -@Database(entities = {MusicData.class},version = 1) +//@Database(entities = {MusicData.class},version = 1) public abstract class SQLiteManager extends RoomDatabase { @NonNull diff --git a/app/src/main/java/com/yutou/nas_music_player/views/AlbumsActivity.java b/app/src/main/java/com/yutou/nas_music_player/views/AlbumsActivity.java new file mode 100644 index 0000000..ff03a0d --- /dev/null +++ b/app/src/main/java/com/yutou/nas_music_player/views/AlbumsActivity.java @@ -0,0 +1,70 @@ +package com.yutou.nas_music_player.views; + +import android.graphics.Bitmap; +import android.os.Bundle; +import android.view.ViewGroup; +import android.widget.ArrayAdapter; +import android.widget.ImageView; +import android.widget.ListView; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.yutou.nas_music_player.Adapters.AlbumsRecyclerAdapter; +import com.yutou.nas_music_player.Datas.MusicData; +import com.yutou.nas_music_player.Interfaces.NetworkInterface; +import com.yutou.nas_music_player.R; +import com.yutou.nas_music_player.containers.MusicContainer; + +import java.util.ArrayList; +import java.util.List; + +public class AlbumsActivity extends AppCompatActivity { + private ImageView album_image; + private RecyclerView listView; + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_album); + String album=getIntent().getStringExtra("album"); + initView(); + initData(album); + } + + private void initData(String album) { + MusicContainer.getLibs().onAlbumMusicData(album, new NetworkInterface() { + @Override + public void httpGetData(Object data, int state) { + List list= (List) data; + listView.setAdapter(new AlbumsRecyclerAdapter(AlbumsActivity.this,list)); + list.get(0).getImg(-1, -1, new NetworkInterface() { + @Override + public void httpGetData(Object data, int state) { + album_image.setImageBitmap((Bitmap) data); + } + + @Override + public void httpError(Exception e) { + + } + }); + + } + + @Override + public void httpError(Exception e) { + + } + }); + + } + + private void initView() { + album_image=findViewById(R.id.album_image); + listView=findViewById(R.id.album_list); + listView.setLayoutManager(new LinearLayoutManager(this)); + } +} diff --git a/app/src/main/java/com/yutou/nas_music_player/views/Fragments/MusicLibsFragment.java b/app/src/main/java/com/yutou/nas_music_player/views/Fragments/MusicLibsFragment.java index f1e6d28..d7ef3aa 100644 --- a/app/src/main/java/com/yutou/nas_music_player/views/Fragments/MusicLibsFragment.java +++ b/app/src/main/java/com/yutou/nas_music_player/views/Fragments/MusicLibsFragment.java @@ -1,6 +1,7 @@ package com.yutou.nas_music_player.views.Fragments; import android.content.Context; +import android.content.Intent; import android.os.Bundle; import android.util.ArrayMap; import android.view.LayoutInflater; @@ -17,9 +18,13 @@ import com.yutou.nas_music_player.Interfaces.NetworkInterface; import com.yutou.nas_music_player.R; import com.yutou.nas_music_player.containers.MediaBrowserHelper; import com.yutou.nas_music_player.containers.MusicContainer; +import com.yutou.nas_music_player.views.AlbumsActivity; +import com.yutou.nas_music_player.views.MainActivity; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.core.app.ActivityOptionsCompat; +import androidx.core.util.Pair; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.LinearLayoutManager; @@ -107,6 +112,28 @@ public class MusicLibsFragment extends Fragment { recyclerView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView parent, View view, int position, long id) { + switch (adapter.getModel()){ + case MusicLibsAdapter.LIBS_MODEL_ALL: + clickAllList(position); + break; + case MusicLibsAdapter.LIBS_MODEL_Album: + clickAlbum(position,view); + break; + } + } + private void clickAlbum(int position,View view){ + MusicLibsAdapter.ViewHolder holder= (MusicLibsAdapter.ViewHolder) view.getTag(); + Pair pImage = Pair.create(holder.itemView, "album_image"); + Bundle bundle = ActivityOptionsCompat.makeSceneTransitionAnimation(getActivity(),pImage).toBundle(); + + MusicData data=adapter.getItem(position); + if(data==null) + return; + Intent intent=new Intent(getContext(), AlbumsActivity.class); + intent.putExtra("album",data.getAlbum()); + startActivity(intent,bundle); + } + private void clickAllList(int position){ MusicData musicData = adapter.getItem(position); if (musicData != null) { if (musicData.isDir()) { @@ -118,7 +145,6 @@ public class MusicLibsFragment extends Fragment { } } } - } }); adapter.setScrollStatus(1); diff --git a/app/src/main/res/layout/activity_album.xml b/app/src/main/res/layout/activity_album.xml new file mode 100644 index 0000000..4621f97 --- /dev/null +++ b/app/src/main/res/layout/activity_album.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/layout_music_libs_item.xml b/app/src/main/res/layout/layout_music_libs_item.xml index 14314ee..6c2bb42 100644 --- a/app/src/main/res/layout/layout_music_libs_item.xml +++ b/app/src/main/res/layout/layout_music_libs_item.xml @@ -3,7 +3,6 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginEnd="15dp" android:descendantFocusability="blocksDescendants" android:orientation="vertical">