Skip to content
This repository has been archived by the owner on Nov 11, 2023. It is now read-only.

Commit

Permalink
Merge pull request #36 from posix4e/android_accessibility_btn
Browse files Browse the repository at this point in the history
Add accessibility settings button on screen
  • Loading branch information
posix4e authored Aug 10, 2023
2 parents 761a286 + 8e05e59 commit 28f5add
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
12 changes: 9 additions & 3 deletions puppet/app/src/main/java/com/ttt246/puppet/ChatterAct.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.ttt246.puppet

import android.annotation.SuppressLint
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.preference.PreferenceManager
Expand All @@ -11,13 +12,18 @@ import androidx.appcompat.app.AppCompatActivity

class ChatterAct : AppCompatActivity() {
private lateinit var webView: WebView
private val TAG = "ChatterActLog"

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
supportActionBar?.hide()
val intent = Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS)
startActivity(intent)

val accessibilitySettingsBtn: Button = findViewById(R.id.accessibilitySettings)
accessibilitySettingsBtn.setOnClickListener {
val intent = Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS)
startActivity(intent)
}

val settingsButton: Button = findViewById(R.id.settingsButton)
webView = findViewById(R.id.webView)
Expand Down Expand Up @@ -47,4 +53,4 @@ class ChatterAct : AppCompatActivity() {
webView.loadUrl(serverUrl)
}
}
}
}
21 changes: 18 additions & 3 deletions puppet/app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,28 @@
android:layout_height="match_parent">

<Button
android:id="@+id/settingsButton"
android:id="@+id/accessibilitySettings"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Settings"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="214dp"
android:layout_marginBottom="16dp"
android:text="Enable Accessibility" />

<Button
android:id="@+id/settingsButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_margin="16dp" />
android:layout_alignParentEnd="true"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:text="Settings" />

<WebView
android:id="@+id/webView"
Expand Down

0 comments on commit 28f5add

Please sign in to comment.