Merge branch 'audiorecorder-3.0.58'
This commit is contained in:
commit
e2d6f17ea2
9 changed files with 78 additions and 19 deletions
|
|
@ -10,8 +10,8 @@ android {
|
|||
applicationId "com.github.axet.audiorecorder"
|
||||
minSdkVersion 9
|
||||
targetSdkVersion 23 // 24+ file:// unable to open
|
||||
versionCode 223
|
||||
versionName "3.0.57"
|
||||
versionCode 224
|
||||
versionName "3.0.58"
|
||||
}
|
||||
signingConfigs {
|
||||
release {
|
||||
|
|
@ -55,5 +55,5 @@ android {
|
|||
dependencies {
|
||||
compile fileTree(dir: 'libs', include: ['*.jar'])
|
||||
testCompile 'junit:junit:4.12'
|
||||
compile 'com.github.axet:android-audio-library:1.0.65' // compile project(':android-audio-library')
|
||||
compile 'com.github.axet:android-audio-library:1.0.67' // compile project(':android-audio-library')
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,9 +37,7 @@ import com.github.axet.audiorecorder.services.RecordingService;
|
|||
public class MainActivity extends AppCompatActivity {
|
||||
public final static String TAG = MainActivity.class.getSimpleName();
|
||||
|
||||
public static final String READ_EXTERNAL_STORAGE = "android.permission.READ_EXTERNAL_STORAGE"; // Manifest.permission.READ_EXTERNAL_STORAGE
|
||||
|
||||
public static final String[] PERMISSIONS = new String[]{READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE};
|
||||
public static final String[] PERMISSIONS = new String[]{Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE};
|
||||
|
||||
FloatingActionButton fab;
|
||||
Handler handler = new Handler();
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import android.view.MenuItem;
|
|||
import android.widget.ProgressBar;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.github.axet.androidlibrary.widgets.NameFormatPreferenceCompat;
|
||||
import com.github.axet.androidlibrary.widgets.SilencePreferenceCompat;
|
||||
import com.github.axet.androidlibrary.widgets.StoragePathPreferenceCompat;
|
||||
import com.github.axet.androidlibrary.widgets.ThemeUtils;
|
||||
|
|
@ -50,7 +51,7 @@ import java.util.List;
|
|||
* href="http://developer.android.com/guide/topics/ui/settings.html">Settings
|
||||
* API Guide</a> for more information on developing a Settings UI.
|
||||
*/
|
||||
public class SettingsActivity extends AppCompatActivity implements SharedPreferences.OnSharedPreferenceChangeListener {
|
||||
public class SettingsActivity extends AppCompatActivity implements SharedPreferences.OnSharedPreferenceChangeListener, PreferenceFragmentCompat.OnPreferenceDisplayDialogCallback {
|
||||
|
||||
public static final String[] PERMISSIONS = new String[]{Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE};
|
||||
|
||||
|
|
@ -75,7 +76,9 @@ public class SettingsActivity extends AppCompatActivity implements SharedPrefere
|
|||
String stringValue = value.toString();
|
||||
String key = preference.getKey();
|
||||
|
||||
if (preference instanceof ListPreference) {
|
||||
if (preference instanceof NameFormatPreferenceCompat) {
|
||||
preference.setSummary(((NameFormatPreferenceCompat) preference).getFormatted(stringValue));
|
||||
} else if (preference instanceof ListPreference) {
|
||||
// For list preferences, look up the correct display value in
|
||||
// the preference's 'entries' list.
|
||||
ListPreference listPreference = (ListPreference) preference;
|
||||
|
|
@ -212,6 +215,15 @@ public class SettingsActivity extends AppCompatActivity implements SharedPrefere
|
|||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPreferenceDisplayDialog(PreferenceFragmentCompat caller, Preference pref) {
|
||||
if (pref instanceof NameFormatPreferenceCompat) {
|
||||
NameFormatPreferenceCompat.show(caller, pref.getKey());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* This fragment shows general preferences only. It is used when the
|
||||
* activity is showing a two-pane settings UI.
|
||||
|
|
|
|||
|
|
@ -16,6 +16,13 @@ public class Storage extends com.github.axet.audiolibrary.app.Storage {
|
|||
super(context);
|
||||
}
|
||||
|
||||
public static String getFormatted(String format, Date date) {
|
||||
format = format.replaceAll("%s", SIMPLE.format(date));
|
||||
format = format.replaceAll("%I", ISO8601.format(date));
|
||||
format = format.replaceAll("%T", "" + System.currentTimeMillis() / 1000);
|
||||
return format;
|
||||
}
|
||||
|
||||
public Uri getNewFile() {
|
||||
SharedPreferences shared = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
String ext = shared.getString(MainApplication.PREFERENCE_ENCODING, "");
|
||||
|
|
@ -24,9 +31,7 @@ public class Storage extends com.github.axet.audiolibrary.app.Storage {
|
|||
|
||||
format = shared.getString(MainApplication.PREFERENCE_FORMAT, format);
|
||||
|
||||
format = format.replaceAll("%s", SIMPLE.format(new Date()));
|
||||
format = format.replaceAll("%I", ISO8601.format(new Date()));
|
||||
format = format.replaceAll("%T", "" + System.currentTimeMillis() / 1000);
|
||||
format = getFormatted(format, new Date());
|
||||
|
||||
Uri path = getStoragePath();
|
||||
String s = path.getScheme();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,39 @@
|
|||
package com.github.axet.audiorecorder.widgets;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
import com.github.axet.audiorecorder.app.Storage;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class NameFormatPreferenceCompat extends com.github.axet.androidlibrary.widgets.NameFormatPreferenceCompat {
|
||||
public NameFormatPreferenceCompat(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
}
|
||||
|
||||
public NameFormatPreferenceCompat(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
public NameFormatPreferenceCompat(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
public NameFormatPreferenceCompat(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFormatted(String str) {
|
||||
CharSequence[] text = getEntries();
|
||||
CharSequence[] values = getEntryValues();
|
||||
for (int i = 0; i < text.length; i++) {
|
||||
String t = text[i].toString();
|
||||
String v = values[i].toString();
|
||||
if (v.equals(str))
|
||||
return t;
|
||||
}
|
||||
return Storage.getFormatted(str, new Date(1487926249000l));
|
||||
}
|
||||
}
|
||||
|
|
@ -4,6 +4,6 @@
|
|||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:fillColor="#000"
|
||||
android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/>
|
||||
</vector>
|
||||
|
|
|
|||
|
|
@ -4,6 +4,6 @@
|
|||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FFffffff"
|
||||
android:fillColor="#000"
|
||||
android:pathData="M9.64,7.64c0.23,-0.5 0.36,-1.05 0.36,-1.64 0,-2.21 -1.79,-4 -4,-4S2,3.79 2,6s1.79,4 4,4c0.59,0 1.14,-0.13 1.64,-0.36L10,12l-2.36,2.36C7.14,14.13 6.59,14 6,14c-2.21,0 -4,1.79 -4,4s1.79,4 4,4 4,-1.79 4,-4c0,-0.59 -0.13,-1.14 -0.36,-1.64L12,14l7,7h3v-1L9.64,7.64zM6,8c-1.1,0 -2,-0.89 -2,-2s0.9,-2 2,-2 2,0.89 2,2 -0.9,2 -2,2zm0,12c-1.1,0 -2,-0.89 -2,-2s0.9,-2 2,-2 2,0.89 2,2 -0.9,2 -2,2zm6,-7.5c-0.28,0 -0.5,-0.22 -0.5,-0.5s0.22,-0.5 0.5,-0.5 0.5,0.22 0.5,0.5 -0.22,0.5 -0.5,0.5zM19,3l-6,6 2,2 7,-7V3z"/>
|
||||
</vector>
|
||||
|
|
|
|||
|
|
@ -4,6 +4,6 @@
|
|||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:fillColor="#000"
|
||||
android:pathData="M9,16.2L4.8,12l-1.4,1.4L9,19 21,7l-1.4,-1.4L9,16.2z"/>
|
||||
</vector>
|
||||
|
|
|
|||
|
|
@ -61,7 +61,8 @@
|
|||
android:layout_height="40dp"
|
||||
android:background="?attr/roundButton"
|
||||
android:contentDescription="@string/cut_button"
|
||||
android:src="@drawable/ic_content_cut_24dp" />
|
||||
android:src="@drawable/ic_content_cut_24dp"
|
||||
android:tint="@android:color/white" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/recording_play"
|
||||
|
|
@ -69,7 +70,8 @@
|
|||
android:layout_height="40dp"
|
||||
android:background="?attr/roundButton"
|
||||
android:contentDescription="@string/play_button"
|
||||
android:src="@drawable/ic_play_arrow_black_24dp" />
|
||||
android:src="@drawable/ic_play_arrow_black_24dp"
|
||||
android:tint="@android:color/white" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/recording_edit_done"
|
||||
|
|
@ -78,7 +80,8 @@
|
|||
android:layout_height="40dp"
|
||||
android:background="?attr/roundButton"
|
||||
android:contentDescription="@string/stop_button"
|
||||
android:src="@drawable/ic_close_24dp" />
|
||||
android:src="@drawable/ic_close_24dp"
|
||||
android:tint="@android:color/white" />
|
||||
</com.github.axet.androidlibrary.widgets.EqualLinearLayout>
|
||||
</FrameLayout>
|
||||
|
||||
|
|
@ -108,7 +111,8 @@
|
|||
android:background="?attr/roundButton"
|
||||
android:contentDescription="@string/cancel_button"
|
||||
android:gravity="center"
|
||||
android:src="@drawable/ic_close_24dp" />
|
||||
android:src="@drawable/ic_close_24dp"
|
||||
android:tint="@android:color/white" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/recording_pause"
|
||||
|
|
@ -116,7 +120,8 @@
|
|||
android:layout_height="40dp"
|
||||
android:background="?attr/roundButton"
|
||||
android:contentDescription="@string/pause_button"
|
||||
android:src="@drawable/ic_pause_black_24dp" />
|
||||
android:src="@drawable/ic_pause_black_24dp"
|
||||
android:tint="@android:color/white" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/recording_done"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue