mirror of
https://github.com/SimpleMobileTools/Simple-Draw.git
synced 2025-02-23 06:57:47 +01:00
misc code style tweaks
This commit is contained in:
parent
5febf58a38
commit
85fc837ad0
@ -7,6 +7,7 @@
|
||||
<uses-permission
|
||||
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
|
||||
android:maxSdkVersion="28" />
|
||||
|
||||
<uses-permission
|
||||
android:name="android.permission.USE_FINGERPRINT"
|
||||
tools:node="remove" />
|
||||
|
@ -54,8 +54,8 @@ class MainActivity : SimpleActivity(), CanvasListener {
|
||||
|
||||
private var defaultPath = ""
|
||||
private var defaultFilename = ""
|
||||
|
||||
private var defaultExtension = PNG
|
||||
|
||||
private var intentUri: Uri? = null
|
||||
private var uriToLoad: Uri? = null
|
||||
private var color = 0
|
||||
@ -81,7 +81,10 @@ class MainActivity : SimpleActivity(), CanvasListener {
|
||||
}
|
||||
|
||||
my_canvas.mListener = this
|
||||
stroke_width_bar.setOnSeekBarChangeListener(onStrokeWidthBarChangeListener)
|
||||
stroke_width_bar.onSeekBarChangeListener { progress ->
|
||||
brushSize = Math.max(progress.toFloat(), 5f)
|
||||
updateBrushSize()
|
||||
}
|
||||
|
||||
setBackgroundColor(config.canvasBackgroundColor)
|
||||
setColor(config.brushColor)
|
||||
@ -676,17 +679,6 @@ class MainActivity : SimpleActivity(), CanvasListener {
|
||||
}
|
||||
}
|
||||
|
||||
private var onStrokeWidthBarChangeListener: SeekBar.OnSeekBarChangeListener = object : SeekBar.OnSeekBarChangeListener {
|
||||
override fun onProgressChanged(seekBar: SeekBar, progress: Int, fromUser: Boolean) {
|
||||
brushSize = Math.max(progress.toFloat(), 5f)
|
||||
updateBrushSize()
|
||||
}
|
||||
|
||||
override fun onStartTrackingTouch(seekBar: SeekBar) {}
|
||||
|
||||
override fun onStopTrackingTouch(seekBar: SeekBar) {}
|
||||
}
|
||||
|
||||
private fun updateBrushSize() {
|
||||
my_canvas.setBrushSize(brushSize)
|
||||
val scale = Math.max(0.03f, brushSize / 100f)
|
||||
|
@ -1,11 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
|
||||
<solid android:color="@color/color_primary" />
|
||||
|
||||
<stroke
|
||||
android:width="@dimen/preview_dot_stroke_size"
|
||||
android:color="@android:color/white" />
|
||||
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
|
||||
<solid android:color="@color/color_primary"/>
|
||||
<stroke android:width="@dimen/preview_dot_stroke_size" android:color="@android:color/white"/>
|
||||
</shape>
|
||||
|
@ -1,3 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:fillColor="#FFFFFF" android:pathData="M17.67 3c-0.26 0-0.51 0.1-0.71 0.29l-3.12 3.12-1.93-1.91-1.41 1.41 1.42 1.42L3 16.25V21h4.75l8.92-8.92 1.42 1.42 1.41-1.41-1.92-1.92 3.12-3.12c0.4-0.4 0.4-1.03 0.01-1.42l-2.34-2.34C18.17 3.1 17.92 3 17.67 3zM6.92 19L5 17.08l8.339-8.348 1.938 1.938z"/>
|
||||
<path android:fillColor="#FFFFFFFF" android:pathData="M17.67 3c-0.26 0-0.51 0.1-0.71 0.29l-3.12 3.12-1.93-1.91-1.41 1.41 1.42 1.42L3 16.25V21h4.75l8.92-8.92 1.42 1.42 1.41-1.41-1.92-1.92 3.12-3.12c0.4-0.4 0.4-1.03 0.01-1.42l-2.34-2.34C18.17 3.1 17.92 3 17.67 3zM6.92 19L5 17.08l8.339-8.348 1.938 1.938z"/>
|
||||
</vector>
|
||||
|
@ -1,12 +1,4 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="m15.9748,2.9503 l4.95,4.94c0.78,0.79 0.78,2.05 0,2.84l-9.19,9.19c-1.56,1.56 -4.09,1.56 -5.66,0l-3.53,-3.53c-0.78,-0.79 -0.78,-2.05 0,-2.84L13.1448,2.9503c0.79,-0.78 2.05,-0.78 2.83,0M3.9548,14.9703l3.54,3.53c0.78,0.79 2.04,0.79 2.83,0l3.53,-3.53 -4.95,-4.95z" />
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="m7.8687,20.0909c0.0003,0.5515 0.4461,0.9968 0.9976,0.9964l11.646,-0.0069c0.5515,-0.0003 0.9968,-0.4461 0.9964,-0.9976 -0.0003,-0.5515 -0.4461,-0.9968 -0.9976,-0.9964L8.8722,19.0862c-0.5515,0.0003 -1.0038,0.4532 -1.0035,1.0047z" />
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:fillColor="#FFFFFFFF" android:pathData="M15.975 2.95l4.95 4.94c0.78 0.79 0.78 2.05 0 2.84l-9.19 9.19c-1.56 1.56-4.09 1.56-5.66 0l-3.53-3.53c-0.78-0.79-0.78-2.05 0-2.84l10.6-10.6c0.79-0.78 2.05-0.78 2.83 0M3.955 14.97l3.54 3.53c0.78 0.79 2.04 0.79 2.83 0l3.53-3.53-4.95-4.95z"/>
|
||||
<path android:fillColor="#FFFFFFFF" android:pathData="M7.869 20.09c0 0.552 0.446 0.998 0.997 0.997l11.646-0.007c0.552 0 0.997-0.446 0.997-0.997 0-0.552-0.446-0.997-0.998-0.997H8.872c-0.551 0-1.004 0.453-1.003 1.005z"/>
|
||||
</vector>
|
||||
|
@ -63,12 +63,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/general_settings" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/settings_general_settings_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/settings_use_english_holder"
|
||||
style="@style/SettingsHolderCheckboxStyle"
|
||||
@ -167,6 +161,5 @@
|
||||
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
@ -38,11 +38,6 @@
|
||||
android:icon="@drawable/ic_print_vector"
|
||||
android:title="@string/print"
|
||||
app:showAsAction="ifRoom" />
|
||||
<item
|
||||
android:id="@+id/more_apps_from_us"
|
||||
android:icon="@drawable/ic_google_play_vector"
|
||||
android:title="@string/more_apps_from_us"
|
||||
app:showAsAction="always" />
|
||||
<item
|
||||
android:id="@+id/settings"
|
||||
android:icon="@drawable/ic_settings_cog_vector"
|
||||
@ -53,4 +48,9 @@
|
||||
android:icon="@drawable/ic_info_vector"
|
||||
android:title="@string/about"
|
||||
app:showAsAction="ifRoom" />
|
||||
<item
|
||||
android:id="@+id/more_apps_from_us"
|
||||
android:icon="@drawable/ic_google_play_vector"
|
||||
android:title="@string/more_apps_from_us"
|
||||
app:showAsAction="ifRoom" />
|
||||
</menu>
|
||||
|
Loading…
x
Reference in New Issue
Block a user