UltimateMusicPicker

This commit is contained in:
2018-10-22 01:23:25 +02:00
parent d6becd15c1
commit 7261795c99
10 changed files with 86 additions and 63 deletions

View File

@@ -37,6 +37,11 @@ public class SCNApp extends Application implements LifecycleObserver
return instance;
}
public static MainActivity getMainActivity()
{
return mainActivity.get();
}
public static boolean isBackground()
{
return isBackground;

View File

@@ -19,7 +19,7 @@ import okhttp3.ResponseBody;
public class ServerCommunication
{
public static final String BASE_URL = SCNApp.LOCAL_DEBUG ? "localhost:1010/" : "https://scn.blackforestbytes.com/";
public static final String BASE_URL = SCNApp.LOCAL_DEBUG ? "http://localhost:1010/" : "https://scn.blackforestbytes.com/";
private static final OkHttpClient client = new OkHttpClient();

View File

@@ -1,5 +1,6 @@
package com.blackforestbytes.simplecloudnotifier.view;
import android.net.Uri;
import android.os.Bundle;
import com.blackforestbytes.simplecloudnotifier.R;
@@ -9,12 +10,15 @@ import com.blackforestbytes.simplecloudnotifier.model.SCNSettings;
import com.blackforestbytes.simplecloudnotifier.service.NotificationService;
import com.google.android.material.tabs.TabLayout;
import org.jetbrains.annotations.NotNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.viewpager.widget.PagerAdapter;
import androidx.viewpager.widget.ViewPager;
import xyz.aprildown.ultimatemusicpicker.MusicPickerListener;
public class MainActivity extends AppCompatActivity
public class MainActivity extends AppCompatActivity implements MusicPickerListener
{
public TabAdapter adpTabs;
@@ -50,4 +54,14 @@ public class MainActivity extends AppCompatActivity
CMessageList.inst().fullSave();
}
@Override
public void onMusicPick(@NotNull Uri uri, @NotNull String s) {
}
@Override
public void onPickCanceled() {
}
}

View File

@@ -1,6 +1,7 @@
package com.blackforestbytes.simplecloudnotifier.view;
import android.media.AudioManager;
import android.net.Uri;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
@@ -13,6 +14,7 @@ import android.widget.Switch;
import android.widget.TextView;
import com.blackforestbytes.simplecloudnotifier.R;
import com.blackforestbytes.simplecloudnotifier.SCNApp;
import com.blackforestbytes.simplecloudnotifier.model.SCNSettings;
import androidx.annotation.NonNull;
@@ -119,8 +121,10 @@ public class SettingsFragment extends Fragment
{
SCNSettings s = SCNSettings.inst();
s.Enabled = prefAppEnabled.isChecked();
s.Enabled = prefAppEnabled.isChecked();
s.LocalCacheSize = prefLocalCacheSize.getSelectedItemPosition()>=0 ? SCNSettings.CHOOSABLE_CACHE_SIZES[prefLocalCacheSize.getSelectedItemPosition()] : 100;
s.save();
}
private int getCacheSizeIndex(int value)
@@ -142,6 +146,6 @@ public class SettingsFragment extends Fragment
.notification()
.alarm()
.music()
.goWithActivity(this, 0, MainActivity.class);
.goWithDialog(SCNApp.getMainActivity().getSupportFragmentManager());
}
}

View File

@@ -6,7 +6,7 @@
android:layout_height="match_parent"
tools:showIn="@layout/activity_main">
<android.support.v7.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -16,7 +16,7 @@
android:minHeight="?attr/actionBarSize"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />
<android.support.design.widget.TabLayout
<com.google.android.material.tabs.TabLayout
android:id="@+id/tab_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -26,7 +26,7 @@
android:minHeight="?attr/actionBarSize"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"/>
<android.support.v4.view.ViewPager
<androidx.viewpager.widget.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="fill_parent"

View File

@@ -7,7 +7,7 @@
android:layout_height="match_parent"
tools:context=".view.AccountFragment">
<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
@@ -216,7 +216,7 @@
app:layout_constraintStart_toStartOf="parent"
tools:layout_editor_absoluteY="352dp" />
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<RelativeLayout
android:id="@+id/loadingPanel"

View File

@@ -5,7 +5,7 @@
android:layout_height="match_parent"
tools:context=".view.NotificationsFragment">
<android.support.v7.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvMessages"
android:layout_width="match_parent"
android:layout_height="wrap_content"

View File

@@ -14,7 +14,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.CardView
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="12dp">
@@ -32,7 +32,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:layout_width="match_parent"
@@ -48,7 +48,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<View
android:layout_width="match_parent"
@@ -57,7 +57,7 @@
android:layout_marginTop="2dp"
android:background="#c0c0c0"/>
<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:layout_width="match_parent"
@@ -86,12 +86,12 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
</androidx.cardview.widget.CardView>
<android.support.v7.widget.CardView
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="12dp">
@@ -109,7 +109,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:layout_width="match_parent"
@@ -125,7 +125,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<View
android:layout_width="match_parent"
@@ -134,7 +134,7 @@
android:layout_marginTop="2dp"
android:background="#c0c0c0"/>
<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
@@ -166,7 +166,7 @@
tools:ignore="HardcodedText" />
</LinearLayout>
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<View
android:layout_width="match_parent"
@@ -175,7 +175,7 @@
android:layout_marginTop="2dp"
android:background="#c0c0c0"/>
<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:layout_width="match_parent"
@@ -191,7 +191,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<View
android:layout_width="match_parent"
@@ -200,7 +200,7 @@
android:layout_marginTop="2dp"
android:background="#c0c0c0"/>
<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:layout_width="match_parent"
@@ -216,7 +216,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<View
android:layout_width="match_parent"
@@ -225,7 +225,7 @@
android:layout_marginTop="2dp"
android:background="#c0c0c0"/>
<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:layout_width="match_parent"
@@ -257,7 +257,7 @@
tools:ignore="ContentDescription" />
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<View
android:layout_width="match_parent"
@@ -266,7 +266,7 @@
android:layout_marginTop="2dp"
android:background="#c0c0c0"/>
<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:layout_width="match_parent"
@@ -282,13 +282,13 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
</androidx.cardview.widget.CardView>
<android.support.v7.widget.CardView
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="12dp">
@@ -306,7 +306,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:layout_width="match_parent"
@@ -322,7 +322,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<View
android:layout_width="match_parent"
@@ -331,7 +331,7 @@
android:layout_marginTop="2dp"
android:background="#c0c0c0"/>
<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
@@ -363,7 +363,7 @@
tools:ignore="HardcodedText" />
</LinearLayout>
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<View
android:layout_width="match_parent"
@@ -372,7 +372,7 @@
android:layout_marginTop="2dp"
android:background="#c0c0c0"/>
<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:layout_width="match_parent"
@@ -388,7 +388,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<View
android:layout_width="match_parent"
@@ -397,7 +397,7 @@
android:layout_marginTop="2dp"
android:background="#c0c0c0"/>
<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:layout_width="match_parent"
@@ -413,7 +413,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<View
android:layout_width="match_parent"
@@ -422,7 +422,7 @@
android:layout_marginTop="2dp"
android:background="#c0c0c0"/>
<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:layout_width="match_parent"
@@ -454,7 +454,7 @@
tools:ignore="ContentDescription" />
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<View
android:layout_width="match_parent"
@@ -463,7 +463,7 @@
android:layout_marginTop="2dp"
android:background="#c0c0c0"/>
<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:layout_width="match_parent"
@@ -479,13 +479,13 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
</androidx.cardview.widget.CardView>
<android.support.v7.widget.CardView
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="12dp">
@@ -503,7 +503,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:layout_width="match_parent"
@@ -519,7 +519,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<View
android:layout_width="match_parent"
@@ -528,7 +528,7 @@
android:layout_marginTop="2dp"
android:background="#c0c0c0"/>
<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
@@ -560,7 +560,7 @@
tools:ignore="HardcodedText" />
</LinearLayout>
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<View
android:layout_width="match_parent"
@@ -569,7 +569,7 @@
android:layout_marginTop="2dp"
android:background="#c0c0c0"/>
<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:layout_width="match_parent"
@@ -585,7 +585,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<View
android:layout_width="match_parent"
@@ -594,7 +594,7 @@
android:layout_marginTop="2dp"
android:background="#c0c0c0"/>
<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:layout_width="match_parent"
@@ -610,7 +610,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<View
android:layout_width="match_parent"
@@ -619,7 +619,7 @@
android:layout_marginTop="2dp"
android:background="#c0c0c0"/>
<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:layout_width="match_parent"
@@ -651,7 +651,7 @@
tools:ignore="ContentDescription" />
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<View
android:layout_width="match_parent"
@@ -660,7 +660,7 @@
android:layout_marginTop="2dp"
android:background="#c0c0c0"/>
<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:layout_width="match_parent"
@@ -676,11 +676,11 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
</androidx.cardview.widget.CardView>
</LinearLayout>

View File

@@ -4,7 +4,7 @@
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto">
<android.support.v7.widget.CardView
<androidx.cardview.widget.CardView
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -14,7 +14,7 @@
card_view:cardCornerRadius="@dimen/card_album_radius">
<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:background="#FFFFFFFF"
android:layout_margin="3dp"
android:layout_width="match_parent"
@@ -73,8 +73,8 @@
android:paddingTop="3dp"
android:contentDescription="@string/desc_priority_icon" />
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</android.support.v7.widget.CardView>
</androidx.cardview.widget.CardView>
</LinearLayout>