Skip to content

Commit

Permalink
Merge pull request #3 from Swatian/improvements
Browse files Browse the repository at this point in the history
UI updates and some fixes
  • Loading branch information
mmarif4u authored Jul 24, 2024
2 parents 1eed67b + cab0a97 commit e703480
Show file tree
Hide file tree
Showing 26 changed files with 459 additions and 535 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Nex Notes is licensed under the GPLv3 License. Please refer to the LICENSE file

## Downloads

[<img alt='Get it on F-Droid' src='https://fdroid.gitlab.io/artwork/badge/get-it-on.png' height="80"/>](https://f-droid.org/packages/com.swatian.nexnotes/)
[<img alt='Get it on F-Droid' src='https://raw.githubusercontent.com/Swatian/nexnotes/main/assets/fdroid.png' height="80"/>](https://f-droid.org/packages/com.swatian.nexnotes/)
[<img alt='Get it on Google Play' src='https://raw.githubusercontent.com/Swatian/nexnotes/main/assets/google-play.png' height="80"/>](https://play.google.com/store/apps/details?id=com.swatian.nexnotes.premium)
[<img alt='Download builds and releases' src='https://raw.githubusercontent.com/Swatian/nexnotes/main/assets/apk-badge.png' height="82"/>](https://github.com/Swatian/nexnotes/releases)

Expand All @@ -21,6 +21,7 @@ Nex Notes is licensed under the GPLv3 License. Please refer to the LICENSE file
- Biometric lock
- Localized
- Search by title, content and topic
- Markdown support

## Contributing

Expand All @@ -41,7 +42,7 @@ We use [Crowdin](https://crowdin.com/project/nexnotes) for translations. If your

## Links

[Website](https://nexnotes.swatian.com/)
[Website](https://nexnotes.swatian.com/)
[Wiki](https://github.com/Swatian/nexnotes/wiki/)

## Thanks
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ android {
applicationId "com.swatian.nexnotes"
minSdk 27
targetSdk 34
versionCode 11
versionName "1.1"
versionCode 12
versionName "1.2"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,13 @@ public View onCreateView(
bottomSheetNotesBinding.closeBs.setOnClickListener(close -> dismiss());

bottomSheetNotesBinding.view.setOnClickListener(
close -> {
view -> {
bottomSheetNotesBinding.contents.setVisibility(View.GONE);
bottomSheetNotesBinding.renderContents.setVisibility(View.VISIBLE);

bottomSheetNotesBinding.edit.setVisibility(View.VISIBLE);
bottomSheetNotesBinding.view.setVisibility(View.GONE);

Markdown.render(
requireContext(),
EmojiParser.parseToUnicode(
Expand All @@ -97,9 +101,12 @@ public View onCreateView(
});

bottomSheetNotesBinding.edit.setOnClickListener(
close -> {
edit -> {
bottomSheetNotesBinding.contents.setVisibility(View.VISIBLE);
bottomSheetNotesBinding.renderContents.setVisibility(View.GONE);

bottomSheetNotesBinding.edit.setVisibility(View.GONE);
bottomSheetNotesBinding.view.setVisibility(View.VISIBLE);
});

assert noteTopicsApi != null;
Expand Down Expand Up @@ -142,7 +149,6 @@ public View onCreateView(
bottomSheetNotesBinding.contents.addTextChangedListener(textWatcher);
} else if (source.equalsIgnoreCase("new")) {

bottomSheetNotesBinding.topicsDropdownDivider.setVisibility(View.GONE);
bottomSheetNotesBinding.topicsDropdownLayout.setVisibility(View.GONE);

bottomSheetNotesBinding.title.addTextChangedListener(textWatcher);
Expand Down Expand Up @@ -186,8 +192,6 @@ public void afterTextChanged(Editable s) {
} else {
if (title.length() > 2) {

bottomSheetNotesBinding.topicsDropdownDivider.setVisibility(
View.VISIBLE);
bottomSheetNotesBinding.topicsDropdownLayout.setVisibility(
View.VISIBLE);

Expand Down
7 changes: 5 additions & 2 deletions app/src/main/res/drawable/shape_input.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@
</solid>

<corners
android:radius="@dimen/dimen18dp">
android:topRightRadius="@dimen/dimen16dp"
android:topLeftRadius="@dimen/dimen16dp"
android:bottomLeftRadius="@dimen/dimen16dp"
android:bottomRightRadius="@dimen/dimen4dp">
</corners>

<padding
android:bottom="@dimen/dimen16dp"
android:left="@dimen/dimen16dp"
android:right="@dimen/dimen16dp"
android:top="@dimen/dimen16dp">
android:top="@dimen/dimen18dp">
</padding>

</shape>
22 changes: 0 additions & 22 deletions app/src/main/res/drawable/shape_input_bottom.xml

This file was deleted.

21 changes: 0 additions & 21 deletions app/src/main/res/drawable/shape_input_no_corners.xml

This file was deleted.

22 changes: 0 additions & 22 deletions app/src/main/res/drawable/shape_input_top.xml

This file was deleted.

2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/nav_view"
android:layout_width="0dp"
android:layout_height="@dimen/dimen72dp"
android:layout_height="@dimen/dimen80dp"
android:layout_marginStart="0dp"
android:layout_marginEnd="0dp"
android:background="?android:attr/windowBackground"
Expand Down
90 changes: 30 additions & 60 deletions app/src/main/res/layout/bottom_sheet_notes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,54 +23,36 @@
android:background="?android:attr/selectableItemBackgroundBorderless"
app:tint="?attr/iconsColor" />

<com.google.android.material.button.MaterialButtonToggleGroup
android:id="@+id/edit_view_toggle"
<com.google.android.material.button.MaterialButton
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
android:id="@+id/view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toEndOf="@+id/close_bs"
app:selectionRequired="true"
app:singleSelection="true"
app:checkedButton="@id/edit"
app:layout_constraintEnd_toStartOf="@+id/topics">

<com.google.android.material.button.MaterialButton
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
android:id="@+id/edit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="@dimen/dimen16dp"
android:paddingEnd="@dimen/dimen16dp"
android:insetRight="@dimen/dimen2dp"
android:layout_gravity="center"
app:icon="@drawable/ic_pencil" />

<com.google.android.material.button.MaterialButton
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
android:id="@+id/view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="@dimen/dimen16dp"
android:paddingEnd="@dimen/dimen16dp"
android:insetLeft="@dimen/dimen2dp"
android:layout_gravity="center"
app:icon="@drawable/ic_view" />

</com.google.android.material.button.MaterialButtonToggleGroup>
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:paddingStart="@dimen/dimen16dp"
android:paddingEnd="@dimen/dimen16dp"
app:cornerRadius="@dimen/dimen16dp"
android:layout_gravity="center"
app:iconSize="@dimen/dimen20dp"
app:icon="@drawable/ic_view" />

<ImageView
android:id="@+id/topics"
<com.google.android.material.button.MaterialButton
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
android:id="@+id/edit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_gravity="center"
android:contentDescription="@string/topics"
app:srcCompat="@drawable/ic_topics"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:paddingStart="@dimen/dimen16dp"
android:paddingEnd="@dimen/dimen16dp"
app:cornerRadius="@dimen/dimen16dp"
android:visibility="gone"
app:tint="?attr/iconsColor" />
android:layout_gravity="center"
app:iconSize="@dimen/dimen20dp"
app:icon="@drawable/ic_pencil" />

</androidx.constraintlayout.widget.ConstraintLayout>

Expand All @@ -84,56 +66,45 @@
<EditText
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="@dimen/dimen48dp"
android:layout_height="@dimen/dimen54dp"
android:autofillHints="@string/title"
android:background="@drawable/shape_input_top"
android:background="@drawable/shape_input"
android:lineSpacingExtra="@dimen/dimen8sp"
android:gravity="start"
android:singleLine="true"
android:inputType="textCapSentences"
android:layout_marginBottom="@dimen/dimen8dp"
android:maxLength="160"
android:hint="@string/title"
android:textSize="@dimen/dimen16sp" />

<com.google.android.material.divider.MaterialDivider
android:id="@+id/topics_dropdown_divider"
android:layout_width="match_parent"
android:layout_height="@dimen/dimen2dp"
app:dividerColor="?attr/divider"
android:background="?android:attr/listDivider" />

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/topics_dropdown_layout"
android:layout_width="match_parent"
android:layout_height="@dimen/dimen44dp"
android:layout_height="@dimen/dimen54dp"
app:boxStrokeWidth="0dp"
app:boxStrokeWidthFocused="0dp"
android:layout_marginBottom="@dimen/dimen8dp"
style="@style/Widget.Material3.TextInputLayout.FilledBox.Dense.ExposedDropdownMenu">

<AutoCompleteTextView
android:id="@+id/topics_dropdown"
android:layout_width="match_parent"
android:layout_height="@dimen/dimen44dp"
android:layout_height="@dimen/dimen54dp"
android:padding="@dimen/dimen2dp"
android:labelFor="@+id/topics_dropdown"
android:background="@drawable/shape_input_no_corners"
android:background="@drawable/shape_input"
android:inputType="none" />

</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.divider.MaterialDivider
android:layout_width="match_parent"
android:layout_height="@dimen/dimen2dp"
app:dividerColor="?attr/divider"
android:background="?android:attr/listDivider" />

<EditText
android:id="@+id/contents"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:minHeight="@dimen/dimen480dp"
android:autofillHints="@string/notes"
android:background="@drawable/shape_input_bottom"
android:background="@drawable/shape_input"
android:lineSpacingExtra="@dimen/dimen8sp"
android:gravity="top"
android:inputType="textMultiLine|textImeMultiLine|textCapSentences"
Expand All @@ -145,18 +116,17 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:minHeight="@dimen/dimen480dp"
android:background="@drawable/shape_input_bottom"
android:background="@drawable/shape_input"
android:lineSpacingExtra="@dimen/dimen8sp"
android:textSize="@dimen/dimen16sp"
android:visibility="gone" />

</LinearLayout>

<!-- fake expand the height -->
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
android:layout_weight="1" />

</LinearLayout>

13 changes: 6 additions & 7 deletions app/src/main/res/layout/bottom_sheet_topics.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,17 @@
android:background="?android:attr/selectableItemBackgroundBorderless"
app:tint="?attr/iconsColor" />

<ImageView
<com.google.android.material.button.MaterialButton
android:id="@+id/save"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="@dimen/dimen54dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_gravity="center"
android:contentDescription="@string/generic_img_copy"
app:srcCompat="@drawable/ic_check"
android:background="?android:attr/selectableItemBackgroundBorderless"
app:tint="?attr/iconsColor" />
android:contentDescription="@string/save"
android:text="@string/save"
style="@style/CustomMaterialButton" />

</androidx.constraintlayout.widget.ConstraintLayout>

Expand All @@ -49,7 +48,7 @@
<EditText
android:id="@+id/topic"
android:layout_width="match_parent"
android:layout_height="@dimen/dimen48dp"
android:layout_height="@dimen/dimen54dp"
android:autofillHints="@string/title"
android:background="@drawable/shape_input"
android:lineSpacingExtra="@dimen/dimen8sp"
Expand Down
Loading

0 comments on commit e703480

Please sign in to comment.