Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inline cover #1190

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 37 additions & 35 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ THE SOFTWARE.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ch.blinkenlights.android.vanilla"
android:versionName="1.3.2"
android:versionName="1.3.2_KM"
android:versionCode="13200"
android:installLocation="auto">
<uses-permission android:name="android.permission.WAKE_LOCK" />
Expand Down Expand Up @@ -64,17 +64,17 @@ THE SOFTWARE.
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths"/>
android:resource="@xml/provider_paths" />
</provider>

<activity
android:name="FullPlaybackActivity"
android:name=".FullPlaybackActivity"
android:launchMode="singleTask" />
<activity
android:name="LibraryActivity"
android:name=".LibraryActivity"
android:launchMode="singleTask"
android:theme="@style/Library"
android:exported="true"
android:launchMode="singleTask">
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.MUSIC_PLAYER" />
Expand All @@ -85,24 +85,25 @@ THE SOFTWARE.

<meta-data
android:name="android.app.shortcuts"
android:resource="@xml/shortcuts"/>

android:resource="@xml/shortcuts" />
</activity>
<activity
android:name="PlaylistActivity"
android:name=".PlaylistActivity"
android:launchMode="singleTask" />
<activity
android:name="MiniPlaybackActivity"
android:theme="@style/PopupDialog"
android:name=".MiniPlaybackActivity"
android:excludeFromRecents="true"
android:launchMode="singleInstance" />
android:launchMode="singleInstance"
android:theme="@style/PopupDialog" />

<receiver
android:name=".OneCellWidget"
android:label="Vanilla Music 1x1"
android:exported="false">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>

<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/one_cell_widget" />
Expand All @@ -114,6 +115,7 @@ THE SOFTWARE.
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>

<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/four_long_widget" />
Expand All @@ -125,6 +127,7 @@ THE SOFTWARE.
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>

<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/four_white_widget" />
Expand All @@ -136,6 +139,7 @@ THE SOFTWARE.
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>

<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/widget_e" />
Expand All @@ -147,6 +151,7 @@ THE SOFTWARE.
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>

<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/four_square_widget" />
Expand All @@ -158,6 +163,7 @@ THE SOFTWARE.
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>

<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/widget_d" />
Expand All @@ -179,7 +185,6 @@ THE SOFTWARE.
<action android:name="ch.blinkenlights.android.vanilla.action.PREVIOUS_SONG" />
</intent-filter>
</service>

<service
android:name=".ScheduledLibraryUpdate"
android:permission="android.permission.BIND_JOB_SERVICE"
Expand All @@ -192,13 +197,8 @@ THE SOFTWARE.
<activity
android:name="FilebrowserStartActivity" />
<activity
android:name="PlaylistObserverDirActivity" />
<activity
android:name="MediaFoldersSelectionActivity" />
<activity
android:name="PermissionRequestActivity"
android:name=".PermissionRequestActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />

<activity
android:name="ShortcutPseudoActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
Expand All @@ -214,40 +214,42 @@ THE SOFTWARE.
android:exported="true" >
<intent-filter>
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="file"/>
<data android:mimeType="audio/*"/>
<data android:mimeType="application/ogg"/>
<data android:mimeType="application/x-ogg"/>
<data android:mimeType="application/x-flac"/>
<data android:mimeType="application/itunes"/>

<data android:scheme="file" />
<data android:mimeType="audio/*" />
<data android:mimeType="application/ogg" />
<data android:mimeType="application/x-ogg" />
<data android:mimeType="application/x-flac" />
<data android:mimeType="application/itunes" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="content"/>
<data android:mimeType="audio/*"/>
<data android:mimeType="application/ogg"/>
<data android:mimeType="application/x-ogg"/>
<data android:mimeType="application/x-flac"/>
<data android:mimeType="application/itunes"/>

<data android:scheme="content" />
<data android:mimeType="audio/*" />
<data android:mimeType="application/ogg" />
<data android:mimeType="application/x-ogg" />
<data android:mimeType="application/x-flac" />
<data android:mimeType="application/itunes" />
</intent-filter>
</activity>

<activity android:name="AudioSearchActivity" android:theme="@style/PopupDialog"
android:exported="true"
android:excludeFromRecents="true">
<intent-filter>
<action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH" />

<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>



<meta-data
android:name="com.google.android.backup.api_key"
android:value="AEdPqrEAAAAIEViwBxSHCdBCOOat4Go_5gSxFU7PhRFjLTeRAw" />

</application>

</manifest>
2 changes: 1 addition & 1 deletion app/src/main/assets/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</head>
<body>
<h1>Vanilla Music</h1>
<p><b>Version:</b> 1.3.2 Released 10. Jan. 2024<br><br>
<p><b>Version:</b> 1.3.2 Released 10. Jan. 2024 (with KIDMODE additions by Thomas Vogt)<br><br>
<b>Website:</b> <a href='https://vanilla-music.github.io/'>https://vanilla-music.github.io/</a><br>
<b>Issue tracker:</b> <a href='https://github.com/vanilla-music/vanilla/issues'>https://github.com/vanilla-music/vanilla/issues</a><br>
<b>Community &amp; support:</b> <a href='https://www.reddit.com/r/vanillamusic'>/r/VanillaMusic</a><br>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ private void populateTabStrip() {
lp.weight = 1;
}

tabTitleView.setText(adapter.getPageTitle(i));
tabTitleView.setText(adapter.getPageTitle(i));
tabView.setOnClickListener(tabClickListener);
String desc = mContentDescriptions.get(i, null);
if (desc != null) {
Expand All @@ -222,9 +222,9 @@ private void populateTabStrip() {

mTabStrip.addView(tabView);
if (i == mViewPager.getCurrentItem()) {
tabView.setSelected(true);
tabView.setSelected(true);
}
}
}
}

public void setContentDescription(int i, String desc) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.graphics.Bitmap;
Expand Down Expand Up @@ -59,6 +60,10 @@ public class BottomBarControls extends LinearLayout
* The artist of the currently playing song
*/
private TextView mArtist;
/**
* The album of the currently playing song
*/
private TextView mAlbum;
/**
* Cover image
*/
Expand Down Expand Up @@ -94,6 +99,7 @@ public BottomBarControls(Context context, AttributeSet attrs) {
public void onFinishInflate() {
mTitle = (TextView)findViewById(R.id.title);
mArtist = (TextView)findViewById(R.id.artist);
mAlbum = (TextView)findViewById(R.id.album);
mCover = (ImageView)findViewById(R.id.cover);
mSearchView = (SearchView)findViewById(R.id.search_view);
mControlsContent = (LinearLayout)findViewById(R.id.content_controls);
Expand Down Expand Up @@ -209,6 +215,14 @@ public void openMenu() {
* @return boolean old state
*/
public boolean showSearch(boolean visible) {
SharedPreferences settings = SharedPrefHelper.getSettings(mContext);
if (settings.getBoolean(PrefKeys.KIDMODE_ENABLED, PrefDefaults.KIDMODE_ENABLED) && !settings.getBoolean(PrefKeys.KIDMODE_SHOW_SEARCH, PrefDefaults.KIDMODE_SHOW_SEARCH)) {
mSearchView.setVisibility(View.GONE);
mControlsContent.setVisibility(View.VISIBLE);

return false;
}

boolean wasVisible = mSearchView.getVisibility() == View.VISIBLE;
if (wasVisible != visible) {
mSearchView.setVisibility(visible ? View.VISIBLE : View.GONE);
Expand Down Expand Up @@ -242,13 +256,16 @@ public void setSong(Song song) {
if (song == null) {
mTitle.setText(null);
mArtist.setText(null);
mAlbum.setText(null);
mCover.setImageBitmap(null);
} else {
Resources res = mContext.getResources();
String title = song.title == null ? res.getString(R.string.unknown) : song.title;
String artist = song.artist == null ? res.getString(R.string.unknown) : song.artist;
String album = song.album == null ? res.getString(R.string.unknown) : song.album;
mTitle.setText(title);
mArtist.setText(artist);
mAlbum.setText(album);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.drawable.Drawable;
import android.os.FileObserver;
import android.view.LayoutInflater;
import android.view.View;
Expand Down Expand Up @@ -245,9 +247,15 @@ public View getView(int pos, View convertView, ViewGroup parent)
{
DraggableRow row;
ViewHolder holder;
SharedPreferences settings = SharedPrefHelper.getSettings(mActivity);

if (convertView == null) {
row = (DraggableRow)mInflater.inflate(R.layout.draggable_row, parent, false);
if (settings.getBoolean(PrefKeys.KIDMODE_ENABLED, PrefDefaults.KIDMODE_ENABLED) && settings.getBoolean(PrefKeys.KIDMODE_ENLARGE_COVERS, PrefDefaults.KIDMODE_ENLARGE_COVERS)) {
row = (DraggableRow)mInflater.inflate(R.layout.draggable_row_xl, parent, false);
}
else {
row = (DraggableRow)mInflater.inflate(R.layout.draggable_row, parent, false);
}
row.setupLayout(DraggableRow.LAYOUT_LISTVIEW);

holder = new ViewHolder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import android.content.Context;
import android.app.Activity;
import android.content.SharedPreferences;
import android.os.Environment;
import android.view.LayoutInflater;
import android.view.View;
Expand Down Expand Up @@ -88,8 +89,14 @@ public FolderPickerAdapter(Context context, int resource) {
public View getView(int pos, View convertView, ViewGroup parent) {
DraggableRow row;

SharedPreferences settings = SharedPrefHelper.getSettings(mContext);
if (convertView == null) {
row = (DraggableRow)mInflater.inflate(R.layout.draggable_row, parent, false);
if (settings.getBoolean(PrefKeys.KIDMODE_ENABLED, PrefDefaults.KIDMODE_ENABLED) && settings.getBoolean(PrefKeys.KIDMODE_ENLARGE_COVERS, PrefDefaults.KIDMODE_ENLARGE_COVERS)) {
row = (DraggableRow)mInflater.inflate(R.layout.draggable_row_xl, parent, false);
}
else {
row = (DraggableRow)mInflater.inflate(R.layout.draggable_row, parent, false);
}
row.setupLayout(DraggableRow.LAYOUT_LISTVIEW);
row.getCoverView().setImageResource(R.drawable.folder);

Expand Down
Loading