aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMarvin Borner2018-09-05 01:15:32 +0200
committerMarvin Borner2018-09-05 01:15:32 +0200
commited96289a395e4b3549f69cced49701d205c85eb2 (patch)
treee2f520607c2c729cfeeb5cef07ef710a707b0016
parent8e2cf1b4a93c0152e9f3d44a77a66fe4d1584dc2 (diff)
Applied constant naming convention :pencil2:
-rw-r--r--app/src/main/java/me/texx/Texx/BugReportActivity.kt2
-rw-r--r--app/src/main/java/me/texx/Texx/CameraActivity.kt8
-rw-r--r--app/src/main/java/me/texx/Texx/PhotoEditorActivity.kt46
-rw-r--r--app/src/main/res/layout/activity_bug_report.xml36
-rw-r--r--app/src/main/res/layout/activity_camera.xml2
-rw-r--r--app/src/main/res/layout/activity_photo_editor.xml24
6 files changed, 59 insertions, 59 deletions
diff --git a/app/src/main/java/me/texx/Texx/BugReportActivity.kt b/app/src/main/java/me/texx/Texx/BugReportActivity.kt
index d6a11ba..947c720 100644
--- a/app/src/main/java/me/texx/Texx/BugReportActivity.kt
+++ b/app/src/main/java/me/texx/Texx/BugReportActivity.kt
@@ -32,7 +32,7 @@ class BugReportActivity : AppCompatActivity() {
setContentView(R.layout.activity_bug_report)
val debugInformation = getDebugInformation()
- debug_text.text = debugInformation
+ text_debug.text = debugInformation
fab.setOnClickListener {
submitToGithub(debugInformation)
diff --git a/app/src/main/java/me/texx/Texx/CameraActivity.kt b/app/src/main/java/me/texx/Texx/CameraActivity.kt
index 4098c9c..7879737 100644
--- a/app/src/main/java/me/texx/Texx/CameraActivity.kt
+++ b/app/src/main/java/me/texx/Texx/CameraActivity.kt
@@ -80,22 +80,22 @@ class CameraActivity : AppCompatActivity() {
}
})
- camera_button.setOnClickListener {
+ button_camera.setOnClickListener {
if (camera.sessionType == SessionType.PICTURE)
camera.capturePicture()
else
camera.startCapturingVideo()
}
- camera_button.setOnLongClickListener {
+ button_camera.setOnLongClickListener {
if (camera.sessionType == SessionType.PICTURE) {
camera.sessionType = SessionType.VIDEO
val videoButtonDrawable: Drawable = this.resources.getDrawable(R.drawable.focus_marker_outline)
videoButtonDrawable.colorFilter = PorterDuffColorFilter(RED, PorterDuff.Mode.SRC_IN)
- camera_button.setBackgroundDrawable(videoButtonDrawable)
+ button_camera.setBackgroundDrawable(videoButtonDrawable)
} else {
camera.sessionType = SessionType.PICTURE
- camera_button.setBackgroundDrawable(this.resources.getDrawable(R.drawable.focus_marker_outline))
+ button_camera.setBackgroundDrawable(this.resources.getDrawable(R.drawable.focus_marker_outline))
}
true
}
diff --git a/app/src/main/java/me/texx/Texx/PhotoEditorActivity.kt b/app/src/main/java/me/texx/Texx/PhotoEditorActivity.kt
index dd3a090..3bec04c 100644
--- a/app/src/main/java/me/texx/Texx/PhotoEditorActivity.kt
+++ b/app/src/main/java/me/texx/Texx/PhotoEditorActivity.kt
@@ -48,7 +48,7 @@ class PhotoEditorActivity : AppCompatActivity() {
private fun initPhotoEditor() {
val filepath = intent.getStringExtra("filepath")
- val imageEditorView = findViewById<PhotoEditorView>(R.id.imageEditor)
+ val imageEditorView = findViewById<PhotoEditorView>(R.id.image_editor)
imageEditorView.source.setImageURI(Uri.parse(filepath))
val photoEditor = PhotoEditor.Builder(this, imageEditorView)
@@ -62,35 +62,35 @@ class PhotoEditorActivity : AppCompatActivity() {
private fun setButtonListeners(photoEditor: PhotoEditor) {
// undo button
- undoButton.setOnClickListener { photoEditor.undo() }
+ button_undo.setOnClickListener { photoEditor.undo() }
// redo button
- redoButton.setOnClickListener { photoEditor.redo() }
+ button_redo.setOnClickListener { photoEditor.redo() }
// draw button
- drawButton.setOnClickListener {
+ button_draw.setOnClickListener {
currentlyDrawing = !currentlyDrawing
photoEditor.setBrushDrawingMode(currentlyDrawing)
- if (currentlyDrawing) colorSeekbar.visibility = View.VISIBLE
+ if (currentlyDrawing) seekbar_color.visibility = View.VISIBLE
else {
- colorSeekbar.visibility = View.GONE
- drawButton.background = ContextCompat.getDrawable(this, R.drawable.ic_mode_edit_white_24dp)
+ seekbar_color.visibility = View.GONE
+ button_draw.background = ContextCompat.getDrawable(this, R.drawable.ic_mode_edit_white_24dp)
}
}
// type button
- typeButton.setOnClickListener {
+ button_type.setOnClickListener {
currentlyTyping = !currentlyTyping
if (currentlyTyping) showTextEditor("")
else hideTextEditor()
}
// text editing "view" for on photo typing
- editText.setOnEditorActionListener { _, actionId, _ ->
+ text_edit.setOnEditorActionListener { _, actionId, _ ->
if (actionId == EditorInfo.IME_ACTION_DONE) {
- photoEditor.addText(editText.text.toString(), typingColor)
- editText.visibility = View.GONE
+ photoEditor.addText(text_edit.text.toString(), typingColor)
+ text_edit.visibility = View.GONE
}
return@setOnEditorActionListener true
}
@@ -111,30 +111,30 @@ class PhotoEditorActivity : AppCompatActivity() {
})
// color seekbar
- colorSeekbar.setOnColorChangeListener { _, _, color ->
+ seekbar_color.setOnColorChangeListener { _, _, color ->
if (currentlyDrawing) {
photoEditor.brushColor = color
- drawButton.setBackgroundColor(color)
+ button_draw.setBackgroundColor(color)
} else if (currentlyTyping) {
typingColor = color
- typeButton.setBackgroundColor(color)
+ button_type.setBackgroundColor(color)
}
}
}
private fun showTextEditor(text: String) {
- colorSeekbar.visibility = View.VISIBLE
- editText.visibility = View.VISIBLE
- editText.imeOptions = EditorInfo.IME_ACTION_DONE
- editText.setText(text)
- editText.requestFocusFromTouch() // set focus
+ seekbar_color.visibility = View.VISIBLE
+ text_edit.visibility = View.VISIBLE
+ text_edit.imeOptions = EditorInfo.IME_ACTION_DONE
+ text_edit.setText(text)
+ text_edit.requestFocusFromTouch() // set focus
val inputManager = this@PhotoEditorActivity.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
- inputManager.showSoftInput(editText, 0)
+ inputManager.showSoftInput(text_edit, 0)
}
private fun hideTextEditor() {
- typeButton.background = ContextCompat.getDrawable(this, R.drawable.ic_text_fields_white_24dp)
- colorSeekbar.visibility = View.GONE
- editText.visibility = View.GONE
+ button_type.background = ContextCompat.getDrawable(this, R.drawable.ic_text_fields_white_24dp)
+ seekbar_color.visibility = View.GONE
+ text_edit.visibility = View.GONE
}
}
diff --git a/app/src/main/res/layout/activity_bug_report.xml b/app/src/main/res/layout/activity_bug_report.xml
index 418aa95..ac50d2f 100644
--- a/app/src/main/res/layout/activity_bug_report.xml
+++ b/app/src/main/res/layout/activity_bug_report.xml
@@ -24,15 +24,31 @@
android:layout_marginStart="24dp"
android:ems="10"
android:hint="@string/bug_report_edit_title_hint"
- android:inputType="text|textAutoCorrect"
+ android:inputType="text|textCapCharacters|textCapWords|textCapSentences|textAutoCorrect|textAutoComplete"
app:layout_constraintBottom_toTopOf="@+id/edit_description"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/title" />
+ <EditText
+ android:id="@+id/edit_description"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="24dp"
+ android:layout_marginStart="24dp"
+ android:layout_marginTop="24dp"
+ android:ems="10"
+ android:hint="@string/bug_report_edit_description"
+ android:inputType="textCapCharacters|textCapWords|textCapSentences|textAutoCorrect|textAutoComplete|textMultiLine"
+ app:layout_constraintBottom_toTopOf="@+id/text_debug"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/edit_title" />
+
<TextView
- android:id="@+id/debug_text"
+ android:id="@+id/text_debug"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="24dp"
@@ -54,22 +70,6 @@
app:layout_constraintEnd_toEndOf="parent"
app:srcCompat="@drawable/ic_send_black_24dp" />
- <EditText
- android:id="@+id/edit_description"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_marginEnd="24dp"
- android:layout_marginStart="24dp"
- android:layout_marginTop="24dp"
- android:ems="10"
- android:hint="@string/bug_report_edit_description"
- android:inputType="textMultiLine"
- app:layout_constraintBottom_toTopOf="@+id/debug_text"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintHorizontal_bias="0.5"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@+id/edit_title" />
-
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
diff --git a/app/src/main/res/layout/activity_camera.xml b/app/src/main/res/layout/activity_camera.xml
index d9b7a35..b28d7e1 100644
--- a/app/src/main/res/layout/activity_camera.xml
+++ b/app/src/main/res/layout/activity_camera.xml
@@ -7,7 +7,7 @@
tools:context=".CameraActivity">
<Button
- android:id="@+id/camera_button"
+ android:id="@+id/button_camera"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginBottom="48dp"
diff --git a/app/src/main/res/layout/activity_photo_editor.xml b/app/src/main/res/layout/activity_photo_editor.xml
index 9561214..be22d3a 100644
--- a/app/src/main/res/layout/activity_photo_editor.xml
+++ b/app/src/main/res/layout/activity_photo_editor.xml
@@ -8,7 +8,7 @@
tools:context=".PhotoEditorActivity">
<ja.burhanrashid52.photoeditor.PhotoEditorView
- android:id="@+id/imageEditor"
+ android:id="@+id/image_editor"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="Kwel image"
@@ -20,7 +20,7 @@
</ja.burhanrashid52.photoeditor.PhotoEditorView>
<android.support.design.widget.FloatingActionButton
- android:id="@+id/floatingActionButton"
+ android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="24dp"
@@ -32,7 +32,7 @@
app:srcCompat="@drawable/ic_send_black_24dp" />
<Button
- android:id="@+id/undoButton"
+ android:id="@+id/button_undo"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignParentStart="true"
@@ -44,7 +44,7 @@
app:layout_constraintTop_toTopOf="parent" />
<Button
- android:id="@+id/redoButton"
+ android:id="@+id/button_redo"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignParentEnd="true"
@@ -52,11 +52,11 @@
android:layout_marginStart="8dp"
android:layout_marginTop="24dp"
android:background="@drawable/ic_redo_white_24dp"
- app:layout_constraintStart_toEndOf="@+id/undoButton"
+ app:layout_constraintStart_toEndOf="@+id/button_undo"
app:layout_constraintTop_toTopOf="parent" />
<Button
- android:id="@+id/drawButton"
+ android:id="@+id/button_draw"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginEnd="24dp"
@@ -66,17 +66,17 @@
app:layout_constraintTop_toTopOf="parent" />
<Button
- android:id="@+id/typeButton"
+ android:id="@+id/button_type"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="24dp"
android:background="@drawable/ic_text_fields_white_24dp"
- app:layout_constraintEnd_toStartOf="@+id/drawButton"
+ app:layout_constraintEnd_toStartOf="@+id/button_draw"
app:layout_constraintTop_toTopOf="parent" />
<com.rtugeek.android.colorseekbar.ColorSeekBar
- android:id="@+id/colorSeekbar"
+ android:id="@+id/seekbar_color"
android:layout_width="38dp"
android:layout_height="300dp"
android:layout_marginEnd="28dp"
@@ -85,12 +85,12 @@
app:barHeight="15dp"
app:colorSeeds="@array/material_colors"
app:isVertical="true"
- app:layout_constraintEnd_toEndOf="@+id/imageEditor"
- app:layout_constraintTop_toBottomOf="@+id/drawButton"
+ app:layout_constraintEnd_toEndOf="@+id/image_editor"
+ app:layout_constraintTop_toBottomOf="@+id/button_draw"
app:thumbHeight="40dp" />
<EditText
- android:id="@+id/editText"
+ android:id="@+id/text_edit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="32dp"