basic ui done
@ -42,6 +42,7 @@ dependencies {
|
||||
implementation("androidx.appcompat:appcompat:1.6.1")
|
||||
implementation("com.google.android.material:material:1.9.0")
|
||||
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
|
||||
implementation("com.github.lukelorusso:VerticalSeekBar:1.2.7")
|
||||
testImplementation("junit:junit:4.13.2")
|
||||
androidTestImplementation("androidx.test.ext:junit:1.1.5")
|
||||
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
|
||||
|
@ -14,7 +14,9 @@
|
||||
tools:targetApi="31">
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true">
|
||||
android:exported="true"
|
||||
android:screenOrientation="landscape"
|
||||
tools:ignore="DiscouragedApi">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
|
BIN
app/src/main/ic_launcher-playstore.png
Normal file
After Width: | Height: | Size: 214 KiB |
@ -3,27 +3,19 @@ package org.pupes.tabletpccontrol
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.widget.SeekBar
|
||||
import com.lukelorusso.verticalseekbar.VerticalSeekBar
|
||||
|
||||
class MainActivity : AppCompatActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_main)
|
||||
|
||||
val seekBar = findViewById<SeekBar>(R.id.seekBar)
|
||||
val audioVerticalSeekBar = findViewById<VerticalSeekBar>(R.id.AudioVerticalSeekBar)
|
||||
|
||||
seekBar.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
|
||||
override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
|
||||
Log.d("SeekBar", "Progress: $progress")
|
||||
}
|
||||
|
||||
override fun onStartTrackingTouch(seekBar: SeekBar?) {
|
||||
// Called when the user starts interacting with the SeekBar
|
||||
}
|
||||
|
||||
override fun onStopTrackingTouch(seekBar: SeekBar?) {
|
||||
// Called when the user stops interacting with the SeekBar
|
||||
}
|
||||
})
|
||||
audioVerticalSeekBar.setOnProgressChangeListener { progress ->
|
||||
// Handle the progress value here
|
||||
Log.d("VerticalSeekBar", "Current progress: $progress")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
</vector>
|
30
app/src/main/res/drawable/ic_launcher_foreground.xml
Normal file
@ -0,0 +1,30 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="16.933"
|
||||
android:viewportHeight="14.393">
|
||||
<group android:scaleX="0.43"
|
||||
android:scaleY="0.3655"
|
||||
android:translateX="4.825905"
|
||||
android:translateY="4.5661793">
|
||||
<path
|
||||
android:pathData="M7.62,13.441L7.62,9.631C7.62,9.104 7.195,8.678 6.668,8.678l-5.715,0c-0.527,0 -0.952,0.425 -0.952,0.952l-0,3.81c-0,0.527 0.425,0.952 0.952,0.952L6.668,14.393C7.195,14.393 7.62,13.968 7.62,13.441ZM0.635,12.171l-0,-1.27l0.317,0l-0,1.27zM1.587,13.838L1.587,9.234L6.668,9.234l-0,4.604z"
|
||||
android:fillColor="#ff9d1e"/>
|
||||
<path
|
||||
android:pathData="m15.346,5.556c0.437,0 0.79,-0.357 0.79,-0.794L16.14,0.794C16.14,0.357 15.782,0 15.346,0L8.996,0C8.559,0 8.202,0.357 8.202,0.794l0,3.969c0,0.437 0.357,0.794 0.794,0.794L7.408,5.556l0,0.794L16.933,6.35L16.933,5.556ZM8.996,0.794L15.346,0.794L15.346,4.762L8.996,4.762Z"
|
||||
android:fillColor="#ff9d1e"/>
|
||||
<path
|
||||
android:pathData="M6.14,5.008 L5.719,5.428 6.095,5.801 7.153,4.743 6.095,3.685 5.721,4.058 6.14,4.479L3.978,4.479C3.687,4.479 3.449,4.717 3.449,5.008l0,2.381l0.529,0l0,-2.381z"
|
||||
android:fillColor="#ff9d1e"/>
|
||||
<path
|
||||
android:pathData="m5.02,3.014c0.004,-0.033 0.007,-0.067 0.007,-0.104 0,-0.035 -0.002,-0.071 -0.008,-0.104L5.243,2.633C5.263,2.617 5.269,2.587 5.256,2.565L5.045,2.199C5.031,2.175 5.004,2.167 4.98,2.175L4.716,2.281C4.661,2.239 4.603,2.204 4.538,2.177L4.498,1.897C4.494,1.871 4.471,1.852 4.445,1.852L4.022,1.852C3.995,1.852 3.974,1.871 3.97,1.897L3.93,2.177C3.865,2.204 3.806,2.24 3.752,2.281L3.488,2.175C3.464,2.166 3.436,2.175 3.423,2.199L3.212,2.565C3.199,2.589 3.204,2.617 3.226,2.633l0.224,0.174C3.444,2.84 3.44,2.876 3.44,2.91c0,0.034 0.002,0.071 0.008,0.104l-0.224,0.174c-0.02,0.015 -0.025,0.045 -0.013,0.067l0.212,0.366c0.013,0.024 0.041,0.032 0.065,0.024l0.263,-0.106c0.055,0.042 0.114,0.077 0.179,0.104l0.04,0.28c0.006,0.026 0.026,0.045 0.053,0.045l0.423,0c0.026,0 0.049,-0.019 0.052,-0.045l0.04,-0.28c0.065,-0.026 0.125,-0.062 0.179,-0.104l0.263,0.106c0.024,0.009 0.052,0 0.065,-0.024l0.212,-0.366c0.013,-0.024 0.008,-0.052 -0.013,-0.067zM4.233,3.307c-0.218,0 -0.397,-0.179 -0.397,-0.397 0,-0.218 0.179,-0.397 0.397,-0.397 0.218,0 0.397,0.179 0.397,0.397 0,0.218 -0.179,0.397 -0.397,0.397z"
|
||||
android:fillColor="#ff9d1e"/>
|
||||
<path
|
||||
android:pathData="m2.778,1.058 l0.265,0.265C3.7,0.665 4.766,0.665 5.424,1.323L5.689,1.058C4.886,0.255 3.582,0.255 2.778,1.058ZM3.307,1.588 L3.572,1.852c0.365,-0.365 0.958,-0.365 1.323,0l0.265,-0.265C4.649,1.077 3.819,1.077 3.307,1.588Z"
|
||||
android:fillColor="#ff9d1e"/>
|
||||
<path
|
||||
android:pathData="m1.901,12.763l0,0.497l1.492,0l0,-0.497zM1.901,9.778l0,0.497l2.487,0L4.389,9.778ZM4.389,13.758l0,-0.497l1.99,0l0,-0.497l-1.99,0l0,-0.497l-0.497,0l0,1.492zM2.896,10.773l0,0.497l-0.995,0l0,0.497l0.995,0l0,0.497l0.497,0l0,-1.492zM6.379,11.768l0,-0.497l-2.487,0l0,0.497zM4.886,10.773l0.497,0L5.384,10.276l0.995,0L6.379,9.778L5.384,9.778L5.384,9.281l-0.497,0z"
|
||||
android:strokeWidth="0.249"
|
||||
android:fillColor="#ff9d1e"/>
|
||||
</group>
|
||||
</vector>
|
5
app/src/main/res/drawable/switch_thumb.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/switch_thumb_unchecked" android:state_checked="false" />
|
||||
<item android:drawable="@drawable/switch_thumb_checked" android:state_checked="true" />
|
||||
</selector>
|
20
app/src/main/res/drawable/switch_thumb_checked.xml
Normal file
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape>
|
||||
<solid android:color="@color/OrangeMain" />
|
||||
<corners android:radius="7dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<item
|
||||
android:bottom="10dp"
|
||||
android:left="10dp"
|
||||
android:right="10dp"
|
||||
android:top="10dp">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/white"/>
|
||||
<corners android:radius="5dp"/>
|
||||
<size android:height="30dp" android:width="60dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
20
app/src/main/res/drawable/switch_thumb_unchecked.xml
Normal file
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape>
|
||||
<solid android:color="@color/OrangeLight" />
|
||||
<corners android:radius="7dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<item
|
||||
android:bottom="10dp"
|
||||
android:left="10dp"
|
||||
android:right="10dp"
|
||||
android:top="10dp">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/white"/>
|
||||
<corners android:radius="5dp"/>
|
||||
<size android:height="30dp" android:width="60dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
16
app/src/main/res/drawable/switch_track.xml
Normal file
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_checked="false">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/OrangeLight"/>
|
||||
<corners android:radius="1dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item android:state_checked="true">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/OrangeMain"/>
|
||||
<corners android:radius="1dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
@ -5,26 +5,56 @@
|
||||
android:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#222"
|
||||
tools:context=".MainActivity">
|
||||
|
||||
<com.lukelorusso.verticalseekbar.VerticalSeekBar
|
||||
android:id="@+id/AudioVerticalSeekBar"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="546dp"
|
||||
android:layout_marginStart="72dp"
|
||||
android:layout_marginLeft="72dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.716"
|
||||
app:vsb_bar_background="#161718"
|
||||
app:vsb_bar_progress_gradient_end="@color/OrangeDark"
|
||||
app:vsb_bar_progress_gradient_start="@color/OrangeMain"
|
||||
app:vsb_progress="0"
|
||||
app:vsb_show_thumb="false" />
|
||||
<!--<com.google.android.material.switchmaterial.SwitchMaterial -->
|
||||
<Switch
|
||||
android:id="@+id/MuteSwitch"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginBottom="50dp"
|
||||
android:scaleX="1.5"
|
||||
android:scaleY="1.5"
|
||||
app:layout_constraintBottom_toTopOf="@id/AudioVerticalSeekBar"
|
||||
app:layout_constraintEnd_toEndOf="@id/AudioVerticalSeekBar"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="@id/AudioVerticalSeekBar"
|
||||
app:track="@drawable/switch_track"
|
||||
android:thumb="@drawable/switch_thumb"
|
||||
tools:ignore="UseSwitchCompatOrMaterialXml" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/VolumeText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Hello World!"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
android:text="@string/master"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintTop_toBottomOf="@id/MuteSwitch"
|
||||
app:layout_constraintStart_toStartOf="@id/MuteSwitch"
|
||||
app:layout_constraintEnd_toEndOf="@id/MuteSwitch"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintVertical_bias="0"
|
||||
android:layout_marginTop="9dp"
|
||||
android:textColor="@color/White"/>
|
||||
|
||||
<!-- Initial progress -->
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/seekBar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:rotation="270"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
|
||||
<background android:drawable="@mipmap/ic_launcher_background"/>
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
|
||||
</adaptive-icon>
|
BIN
app/src/main/res/mipmap-hdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.4 KiB |
BIN
app/src/main/res/mipmap-hdpi/ic_launcher_background.webp
Normal file
After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 4.5 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 695 B |
Before Width: | Height: | Size: 982 B |
BIN
app/src/main/res/mipmap-mdpi/ic_launcher_background.webp
Normal file
After Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 2.6 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.9 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_launcher_background.webp
Normal file
After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 7.4 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.8 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_launcher_background.webp
Normal file
After Width: | Height: | Size: 53 KiB |
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 13 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 3.8 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.webp
Normal file
After Width: | Height: | Size: 84 KiB |
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 20 KiB |
@ -2,4 +2,8 @@
|
||||
<resources>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
<color name="OrangeLight">#fcd49f</color>
|
||||
<color name="OrangeMain">#ff9100</color>
|
||||
<color name="OrangeDark">#7a4b0f</color>
|
||||
<color name="White">#ffffff</color>
|
||||
</resources>
|
@ -1,3 +1,4 @@
|
||||
<resources>
|
||||
<string name="app_name">Tablet PC control</string>
|
||||
<string name="master">Master</string>
|
||||
</resources>
|
@ -2,4 +2,13 @@
|
||||
plugins {
|
||||
alias(libs.plugins.android.application) apply false
|
||||
alias(libs.plugins.kotlin.android) apply false
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
maven("https://jitpack.io") // Add JitPack repository here
|
||||
}
|
||||
}*/
|
@ -20,4 +20,5 @@ kotlin.code.style=official
|
||||
# Enables namespacing of each library's R class so that its R class includes only the
|
||||
# resources declared in the library itself and none from the library's dependencies,
|
||||
# thereby reducing the size of the R class for that library
|
||||
android.nonTransitiveRClass=true
|
||||
android.nonTransitiveRClass=true
|
||||
android.injected.testOnly=false
|
@ -16,6 +16,7 @@ dependencyResolutionManagement {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
maven("https://jitpack.io")
|
||||
}
|
||||
}
|
||||
|
||||
|