Added About DialogPreference and new logo
This commit is contained in:
parent
fb171e7af0
commit
9167ae2c91
|
@ -21,7 +21,7 @@
|
|||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".SettingsActivity"
|
||||
android:name=".preferences.SettingsActivity"
|
||||
android:label="@string/title_activity_settings"
|
||||
android:parentActivityName=".MainActivity">
|
||||
<meta-data
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package nonphatic.quoz;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.ActivityOptions;
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
|
@ -9,26 +8,18 @@ import android.content.Intent;
|
|||
import android.content.SharedPreferences;
|
||||
import android.graphics.Color;
|
||||
import android.media.MediaPlayer;
|
||||
import android.preference.Preference;
|
||||
import android.preference.PreferenceActivity;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.design.widget.FloatingActionButton;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v7.app.ActionBar;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.transition.Explode;
|
||||
import android.util.Log;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import be.tarsos.dsp.AudioDispatcher;
|
||||
import be.tarsos.dsp.io.android.AudioDispatcherFactory;
|
||||
import be.tarsos.dsp.onsets.ComplexOnsetDetector;
|
||||
import be.tarsos.dsp.onsets.OnsetHandler;
|
||||
import nonphatic.quoz.preferences.SettingsActivity;
|
||||
|
||||
import java.util.Random;
|
||||
import java.util.Timer;
|
||||
|
|
|
@ -0,0 +1,57 @@
|
|||
package nonphatic.quoz.preferences;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.preference.DialogPreference;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import nonphatic.quoz.R;
|
||||
|
||||
/**
|
||||
* Created by Jonathan on 2016-08-07.
|
||||
*/
|
||||
public class AboutDialogPreference extends DialogPreference {
|
||||
public AboutDialogPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
}
|
||||
|
||||
public AboutDialogPreference(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
public AboutDialogPreference(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
public AboutDialogPreference(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPrepareDialogBuilder(AlertDialog.Builder builder) {
|
||||
super.onPrepareDialogBuilder(builder);
|
||||
builder.setNegativeButton(null, null);
|
||||
builder.setPositiveButton(null, null);
|
||||
builder.setTitle(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onBindDialogView(View view) {
|
||||
super.onBindDialogView(view);
|
||||
|
||||
ImageView nonphaticLogo = (ImageView)view.findViewById(R.id.nonphatic_logo);
|
||||
nonphaticLogo.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
public boolean onLongClick(View view) {
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||
//intent.setData(Uri.parse("market://search?q=pub:nonphatic"));
|
||||
intent.setData(Uri.parse("https://github.com/nonphatic"));
|
||||
getContext().startActivity(intent);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package nonphatic.quoz;
|
||||
package nonphatic.quoz.preferences;
|
||||
|
||||
import android.content.res.Configuration;
|
||||
import android.os.Bundle;
|
|
@ -1,4 +1,4 @@
|
|||
package nonphatic.quoz;
|
||||
package nonphatic.quoz.preferences;
|
||||
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
|
@ -6,25 +6,19 @@ import android.content.Context;
|
|||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.Configuration;
|
||||
import android.media.Ringtone;
|
||||
import android.media.RingtoneManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.preference.DialogPreference;
|
||||
import android.preference.ListPreference;
|
||||
import android.preference.Preference;
|
||||
import android.preference.PreferenceActivity;
|
||||
import android.support.v4.app.FragmentTransaction;
|
||||
import android.support.v7.app.ActionBar;
|
||||
import android.preference.PreferenceFragment;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.preference.RingtonePreference;
|
||||
import android.text.TextUtils;
|
||||
import android.transition.Explode;
|
||||
import android.view.MenuItem;
|
||||
import android.support.v4.app.NavUtils;
|
||||
|
||||
import java.util.List;
|
||||
import nonphatic.quoz.R;
|
||||
|
||||
/**
|
||||
* A {@link PreferenceActivity} that presents a set of application settings. On
|
Binary file not shown.
After Width: | Height: | Size: 51 KiB |
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
<ImageView
|
||||
android:id="@+id/nonphatic_logo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:scaleType="fitStart"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/nonphatic_colour_light">
|
||||
</ImageView>
|
||||
</LinearLayout>
|
Binary file not shown.
Before Width: | Height: | Size: 23 KiB |
Binary file not shown.
Before Width: | Height: | Size: 47 KiB |
|
@ -1,8 +0,0 @@
|
|||
<preference-headers xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<header
|
||||
android:fragment="nonphatic.quoz.SettingsActivity$PreferencesFragment"
|
||||
android:icon="@drawable/ic_info_black_24dp"
|
||||
android:title="General" />
|
||||
|
||||
</preference-headers>
|
|
@ -8,7 +8,7 @@
|
|||
android:defaultValue="30">
|
||||
</SeekBarPreference>
|
||||
<ListPreference
|
||||
android:title="Change Mode"
|
||||
android:title="Change mode"
|
||||
android:key="change_mode"
|
||||
android:defaultValue="tap"
|
||||
android:entries="@array/preferences_mode_title"
|
||||
|
@ -17,4 +17,8 @@
|
|||
<Preference
|
||||
android:title="Reset settings"
|
||||
android:key="reset_button" />
|
||||
<nonphatic.quoz.preferences.AboutDialogPreference
|
||||
android:title="About"
|
||||
android:key="about"
|
||||
android:dialogLayout="@layout/preference_about_dialog" />
|
||||
</PreferenceScreen>
|
Loading…
Reference in New Issue