Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
Change log for AWARE
4.7.4.beta
- Fix note taking button display UI

4.7.3.beta
- add column for record bluetooth connection status

Expand Down
2 changes: 1 addition & 1 deletion aware-core/aware.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
mqtt_libs = '1.2.1'
ion_libs = "2.+"
google_libs = "17.0.0"
version_code = 3
version_code = 4
version_readable = "4.7." + version_code + "." + "beta"
compile_sdk = 28
target_sdk = 28
Expand Down
2 changes: 1 addition & 1 deletion aware-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ dependencies {
implementation "org.eclipse.paho:org.eclipse.paho.client.mqttv3:$mqtt_libs"
implementation 'com.koushikdutta.ion:ion:2.2.1'
implementation 'com.google.android.material:material:1.1.0-alpha09'
implementation "org.jetbrains.anko:anko:$anko_version"
// implementation "org.jetbrains.anko:anko:$anko_version"
implementation 'androidx.gridlayout:gridlayout:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.annotation:annotation:1.1.0'
Expand Down
2 changes: 1 addition & 1 deletion aware-phone/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ if (System.getenv("storeFile") != null && System.getenv("storePassword") != null
dependencies {

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "org.jetbrains.anko:anko:$anko_version"
// implementation "org.jetbrains.anko:anko:$anko_version"

implementation "me.dm7.barcodescanner:zbar:1.9.8"

Expand Down
3 changes: 2 additions & 1 deletion aware-phone/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@
<activity
android:name=".ui.TakeNoteActivity"
android:label="Take Note"
android:exported="false">
android:exported="false"
android:windowSoftInputMode="adjustResize">
</activity>
<receiver
android:name="com.aware.Aware$AndroidPackageMonitor"
Expand Down
40 changes: 38 additions & 2 deletions aware-phone/src/main/java/com/aware/phone/ui/TakeNoteActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import android.view.View;

import android.widget.EditText;
import android.widget.ScrollView;
import android.widget.TextView;
import android.widget.Toast;

Expand All @@ -29,6 +30,7 @@
public class TakeNoteActivity extends AppCompatActivity {
private EditText noteEditText;
private TextView charCountText;
private ScrollView scrollView;
private final int MAX_CHARS = 10000;

@SuppressLint("MissingInflatedId")
Expand All @@ -39,6 +41,7 @@ protected void onCreate(Bundle savedInstanceState) {

noteEditText = findViewById(R.id.note_edit_text);
charCountText = findViewById(R.id.char_count_text);
scrollView = findViewById(R.id.scroll_view);

findViewById(R.id.save_button).setOnClickListener(new View.OnClickListener() {
@Override
Expand Down Expand Up @@ -69,14 +72,47 @@ public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2)
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
charCountText.setText(charSequence.length() + "/" + MAX_CHARS);

// Only auto-scroll if cursor is at or near the end of the text
int cursorPosition = noteEditText.getSelectionStart();
int textLength = charSequence.length();
if (cursorPosition >= textLength) {
scrollToBottom();
}
}

@Override
public void afterTextChanged(Editable editable) {}
});

});

// Auto-scroll to bottom when EditText gains focus (keyboard appears)
noteEditText.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
if (hasFocus) {
// Post the scroll action to ensure layout is complete
scrollView.post(new Runnable() {
@Override
public void run() {
scrollToBottom();
}
});
}
}
});
}

private void scrollToBottom() {
scrollView.post(new Runnable() {
@Override
public void run() {
// Scroll to the absolute bottom to ensure buttons are visible
View lastChild = scrollView.getChildAt(scrollView.getChildCount() - 1);
int bottom = lastChild.getBottom() + scrollView.getPaddingBottom();
int delta = bottom - (scrollView.getScrollY() + scrollView.getHeight());
scrollView.smoothScrollBy(0, delta);
}
});
}

private void saveNote() {
Expand Down
105 changes: 54 additions & 51 deletions aware-phone/src/main/res/layout/activity_take_note.xml
Original file line number Diff line number Diff line change
@@ -1,69 +1,72 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/scroll_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="16dp">

<EditText
android:id="@+id/note_edit_text"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="top"
android:hint="Enter your note here..."
android:inputType="textMultiLine"
android:maxLength="10000"/>
android:fillViewport="true">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
android:orientation="vertical"
android:padding="16dp">

<TextView
android:layout_width="0dp"
<EditText
android:id="@+id/note_edit_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Note" />
android:minHeight="200dp"
android:gravity="top"
android:hint="Enter your note here..."
android:inputType="textMultiLine"
android:maxLength="10000"/>

<TextView
android:id="@+id/char_count_text"
android:layout_width="wrap_content"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="0/10000" />
</LinearLayout>
android:orientation="horizontal"
android:layout_marginTop="8dp">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="16px"
android:paddingHorizontal="16px">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Note" />

<Button
android:id="@+id/cancel_button"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_marginEnd="8dp"
android:background="@color/lightGray"
android:text="Cancel" />
<TextView
android:id="@+id/char_count_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0/10000" />
</LinearLayout>

<Button
android:id="@+id/save_button"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@color/primaryDark"
android:textColor="@android:color/white"
android:text="Save"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="16dp">

</LinearLayout>
<Button
android:id="@+id/cancel_button"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginEnd="8dp"
android:background="@color/lightGray"
android:text="Cancel" />

<Space
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.5"/>
<Button
android:id="@+id/save_button"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@color/primaryDark"
android:textColor="@android:color/white"
android:text="Save"/>

</LinearLayout>

</LinearLayout>

</LinearLayout>
</ScrollView>
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
mqtt_libs = '1.2.1'
ion_libs = "2.+"
google_libs = "17.0.0"
version_code = 3
version_code = 4
version_readable = "4.7." + version_code + ".beta"

compile_sdk = 28
Expand Down
4 changes: 2 additions & 2 deletions resources/aware-phone-arm64-v8a-release.apk
Git LFS file not shown
4 changes: 2 additions & 2 deletions resources/aware-phone-armeabi-release.apk
Git LFS file not shown
4 changes: 2 additions & 2 deletions resources/aware-phone-armeabi-v7a-release.apk
Git LFS file not shown
4 changes: 2 additions & 2 deletions resources/aware-phone-x86-release.apk
Git LFS file not shown
4 changes: 2 additions & 2 deletions resources/aware-phone-x86_64-release.apk
Git LFS file not shown
36 changes: 18 additions & 18 deletions resources/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,57 +15,57 @@
"value": "x86_64"
}
],
"versionCode": 3,
"versionName": "4.7.3.beta",
"versionCode": 4,
"versionName": "4.7.4.beta",
"outputFile": "aware-phone-x86_64-release.apk"
},
{
"type": "ONE_OF_MANY",
"filters": [
{
"filterType": "ABI",
"value": "x86"
"value": "arm64-v8a"
}
],
"versionCode": 3,
"versionName": "4.7.3.beta",
"outputFile": "aware-phone-x86-release.apk"
"versionCode": 4,
"versionName": "4.7.4.beta",
"outputFile": "aware-phone-arm64-v8a-release.apk"
},
{
"type": "ONE_OF_MANY",
"filters": [
{
"filterType": "ABI",
"value": "armeabi"
"value": "x86"
}
],
"versionCode": 3,
"versionName": "4.7.3.beta",
"outputFile": "aware-phone-armeabi-release.apk"
"versionCode": 4,
"versionName": "4.7.4.beta",
"outputFile": "aware-phone-x86-release.apk"
},
{
"type": "ONE_OF_MANY",
"filters": [
{
"filterType": "ABI",
"value": "armeabi-v7a"
"value": "armeabi"
}
],
"versionCode": 3,
"versionName": "4.7.3.beta",
"outputFile": "aware-phone-armeabi-v7a-release.apk"
"versionCode": 4,
"versionName": "4.7.4.beta",
"outputFile": "aware-phone-armeabi-release.apk"
},
{
"type": "ONE_OF_MANY",
"filters": [
{
"filterType": "ABI",
"value": "arm64-v8a"
"value": "armeabi-v7a"
}
],
"versionCode": 3,
"versionName": "4.7.3.beta",
"outputFile": "aware-phone-arm64-v8a-release.apk"
"versionCode": 4,
"versionName": "4.7.4.beta",
"outputFile": "aware-phone-armeabi-v7a-release.apk"
}
]
}