Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
My notepad
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
9731301
My notepad
Commits
7b22d50a
Commit
7b22d50a
authored
Nov 12, 2020
by
9731301
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change recycler manger to staggered
parent
4738181f
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
75 additions
and
71 deletions
+75
-71
build.gradle
app/build.gradle
+3
-4
MainActivity.java
app/src/main/java/com/example/mynotepad/MainActivity.java
+0
-4
ArchivedNoesListFragment.java
...nuFeatures/AllArchivedNotes/ArchivedNoesListFragment.java
+3
-2
AllNotesListFragment.java
...mynotepad/MenuFeatures/AllNotes/AllNotesListFragment.java
+4
-3
activity_main.xml
app/src/main/res/layout/activity_main.xml
+0
-30
custom_allnotes_item.xml
app/src/main/res/layout/custom_allnotes_item.xml
+36
-20
custom_gallery_item.xml
app/src/main/res/layout/custom_gallery_item.xml
+29
-8
No files found.
app/build.gradle
View file @
7b22d50a
...
...
@@ -32,12 +32,11 @@ dependencies {
androidTestImplementation
'androidx.test.espresso:espresso-core:3.3.0'
implementation
'androidx.navigation:navigation-fragment:2.3.1'
implementation
'androidx.navigation:navigation-ui:2.3.1'
compile
'com.alirezaafkar:sundatepicker:2.0.4'
implementation
'com.alirezaafkar:sundatepicker:2.0.4'
def
room_version
=
"2.2.5"
implementation
"androidx.room:room-runtime:
$room_version
"
annotationProcessor
"androidx.room:room-compiler:
$room_version
"
implementation
"androidx.room:room-runtime:
2.2.5
"
annotationProcessor
"androidx.room:room-compiler:
2.2.5
"
//i added these parts just for voice recorder
def
nav_version
=
"2.3.1"
...
...
app/src/main/java/com/example/mynotepad/MainActivity.java
View file @
7b22d50a
...
...
@@ -113,10 +113,6 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
startActivity
(
new
Intent
(
getApplicationContext
(),
PicsActivity
.
class
));
}
public
void
onProgramsClicked
(
View
view
)
{
}
@SuppressLint
(
"NonConstantResourceId"
)
@Override
public
boolean
onNavigationItemSelected
(
MenuItem
item
)
{
...
...
app/src/main/java/com/example/mynotepad/MenuFeatures/AllArchivedNotes/ArchivedNoesListFragment.java
View file @
7b22d50a
...
...
@@ -9,6 +9,7 @@ import androidx.navigation.NavController;
import
androidx.navigation.Navigation
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
import
androidx.recyclerview.widget.StaggeredGridLayoutManager
;
import
android.view.LayoutInflater
;
import
android.view.View
;
...
...
@@ -92,10 +93,10 @@ public class ArchivedNoesListFragment extends Fragment {
// show list with recycler view
recyclerView
=
view
.
findViewById
(
R
.
id
.
recyclerView
);
LinearLayoutManager
linearLayoutManager
=
new
LinearLayoutManager
(
getContext
(),
LinearLayoutManager
.
VERTICAL
,
false
);
StaggeredGridLayoutManager
staggeredGridLayoutManager
=
new
StaggeredGridLayoutManager
(
2
,
LinearLayoutManager
.
VERTICAL
);
myarchivedAdaptor
=
new
MyArchivedAdaptor
(
myNotes
,
myDates
);
recyclerView
.
setAdapter
(
myarchivedAdaptor
);
recyclerView
.
setLayoutManager
(
linear
LayoutManager
);
recyclerView
.
setLayoutManager
(
staggeredGrid
LayoutManager
);
addListeners
();
}
...
...
app/src/main/java/com/example/mynotepad/MenuFeatures/AllNotes/AllNotesListFragment.java
View file @
7b22d50a
...
...
@@ -9,6 +9,8 @@ import androidx.navigation.NavController;
import
androidx.navigation.Navigation
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
import
androidx.recyclerview.widget.StaggeredGridLayoutManager
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.ViewGroup
;
...
...
@@ -90,12 +92,11 @@ public class AllNotesListFragment extends Fragment {
// show list with recycler view
recyclerView
=
view
.
findViewById
(
R
.
id
.
recyclerView
);
LinearLayoutManager
linearLayoutManager
=
new
LinearLayoutManager
(
getContext
(),
LinearLayoutManager
.
VERTICAL
,
false
);
StaggeredGridLayoutManager
staggeredGridLayoutManager
=
new
StaggeredGridLayoutManager
(
2
,
LinearLayoutManager
.
VERTICAL
);
myAdaptor
=
new
MyAllNotesAdaptor
(
myNotes
);
recyclerView
.
setLayoutManager
(
linear
LayoutManager
);
recyclerView
.
setLayoutManager
(
staggeredGrid
LayoutManager
);
recyclerView
.
setAdapter
(
myAdaptor
);
}
private
void
addListeners
()
{
...
...
app/src/main/res/layout/activity_main.xml
View file @
7b22d50a
...
...
@@ -150,36 +150,6 @@
app:tint=
"?android:textColor"
android:src=
"@drawable/ic_noted_pictures"
/>
</LinearLayout>
<LinearLayout
android:id=
"@+id/programBtn"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"12dp"
android:background=
"@drawable/bg_button"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/program"
android:layout_width=
"120dp"
android:layout_height=
"54dp"
android:gravity=
"center"
android:onClick=
"onProgramsClicked"
android:text=
"@string/programs"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.502"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/button6"
/>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@drawable/bg_icon"
android:onClick=
"onProgramsClicked"
android:padding=
"10dp"
app:tint=
"?android:textColor"
android:src=
"@drawable/ic_program"
/>
</LinearLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
...
...
app/src/main/res/layout/custom_allnotes_item.xml
View file @
7b22d50a
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"160dp"
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
android:background=
"@drawable/bg_row"
>
<TextView
android:id=
"@+id/titleTv"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_weight=
"1"
android:layout_marginLeft=
"15dp"
android:layout_marginRight=
"15dp"
android:layout_marginTop=
"12dp"
android:text=
"title"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentStart=
"true"
android:layout_alignParentLeft=
"true"
android:layout_alignParentTop=
"true"
android:layout_alignParentEnd=
"true"
android:layout_alignParentRight=
"true"
android:layout_marginStart=
"16dp"
android:layout_marginLeft=
"16dp"
android:layout_marginTop=
"8dp"
android:layout_marginEnd=
"16dp"
android:layout_marginRight=
"16dp"
android:padding=
"5dp"
android:text=
"title"
android:textColor=
"?android:textColor"
android:textSize=
"20dp"
/>
<TextView
android:id=
"@+id/descriptionTv"
android:layout_marginTop=
"2dp"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_weight=
"3"
android:layout_marginLeft=
"15dp"
android:layout_marginRight=
"15dp"
android:lines=
"3"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_below=
"@+id/titleTv"
android:layout_alignParentStart=
"true"
android:layout_alignParentLeft=
"true"
android:layout_alignParentEnd=
"true"
android:layout_alignParentRight=
"true"
android:layout_marginEnd=
"16dp"
android:layout_marginRight=
"16dp"
android:layout_marginStart=
"16dp"
android:layout_marginLeft=
"16dp"
android:layout_marginBottom=
"16dp"
android:padding=
"5dp"
android:textColor=
"?android:textColor"
android:text=
"body text"
android:textSize=
"12dp"
/>
android:textColor=
"?android:textColor"
android:textSize=
"12dp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/titleTv"
/>
</LinearLayout>
\ No newline at end of file
</RelativeLayout>
\ No newline at end of file
app/src/main/res/layout/custom_gallery_item.xml
View file @
7b22d50a
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:orientation=
"vertical"
android:background=
"
?colorButtonNormal
"
android:background=
"
@drawable/bg_border
"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
android:layout_height=
"200dp"
>
<ImageView
android:id=
"@+id/img_gallery"
android:adjustViewBounds=
"true"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
android:layout_height=
"match_parent"
android:layout_marginStart=
"10dp"
android:layout_marginLeft=
"10dp"
android:layout_marginTop=
"10dp"
android:layout_marginEnd=
"10dp"
android:layout_marginRight=
"10dp"
android:layout_marginBottom=
"8dp"
android:adjustViewBounds=
"true"
app:layout_constraintBottom_toTopOf=
"@+id/tv_gallery"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/tv_gallery"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_marginStart=
"10dp"
android:layout_marginLeft=
"10dp"
android:layout_marginEnd=
"10dp"
android:layout_marginRight=
"10dp"
android:layout_marginBottom=
"10dp"
android:textColor=
"?android:textColorPrimary"
android:textStyle=
"bold"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
</LinearLayout>
\ No newline at end of file
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment