Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
likorn
/
vocabulary_notebook
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
38c1cff9
authored
Nov 12, 2018
by
Paktalin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed sort button design
parent
8807a572
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
34 additions
and
65 deletions
.idea/assetWizardSettings.xml
app/src/main/java/com/paktalin/vocabularynotebook/ui/activities/MainActivity.kt
app/src/main/java/com/paktalin/vocabularynotebook/utils/ActivityUtil.kt
app/src/main/res/drawable/ic_sort_az.xml → app/src/main/res/drawable/ic_sort.xml
app/src/main/res/drawable/ic_time.xml
app/src/main/res/drawable/marker.png
app/src/main/res/drawable/marker_green.png
app/src/main/res/layout/fragment_editable_word.xml
app/src/main/res/layout/word_item.xml
app/src/main/res/menu/options_menu.xml
app/src/main/res/values/colors.xml
app/src/main/res/values/strings.xml
app/src/main/res/values/styles.xml
.idea/assetWizardSettings.xml
View file @
38c1cff9
...
...
@@ -19,8 +19,8 @@
<option
name=
"values"
>
<map>
<entry
key=
"assetSourceType"
value=
"FILE"
/>
<entry
key=
"outputName"
value=
"ic_
time
"
/>
<entry
key=
"sourceFile"
value=
"C:\Users\litak\Desktop\baseline-
access_time
-24px.svg"
/>
<entry
key=
"outputName"
value=
"ic_
sort
"
/>
<entry
key=
"sourceFile"
value=
"C:\Users\litak\Desktop\baseline-
sort
-24px.svg"
/>
</map>
</option>
</PersistentState>
...
...
app/src/main/java/com/paktalin/vocabularynotebook/ui/activities/MainActivity.kt
View file @
38c1cff9
...
...
@@ -42,29 +42,17 @@ class MainActivity : AppCompatActivity() {
optionsMenu
=
menu
!!
menuInflater
.
inflate
(
R
.
menu
.
options_menu
,
menu
)
searchView
=
menu
.
findItem
(
R
.
id
.
search
).
actionView
as
SearchView
optionsMenu
.
findItem
(
R
.
id
.
sortByWord
).
isVisible
=
false
optionsMenu
.
findItem
(
R
.
id
.
sortByTranslation
).
isVisible
=
false
return
true
}
override
fun
onOptionsItemSelected
(
item
:
MenuItem
?):
Boolean
{
val
vocabularyAdapter
=
recyclerView
.
adapter
as
VocabularyAdapter
if
(
item
!!
.
itemId
==
R
.
id
.
sortByTime
)
{
if
(
item
!!
.
itemId
==
R
.
id
.
sortByTime
)
vocabularyAdapter
.
sortOrder
=
SORT_BY_TIME
if
(
item
.
itemId
==
R
.
id
.
sortByWord
)
vocabularyAdapter
.
sortOrder
=
SORT_BY_WORD
hideMenuItem
(
optionsMenu
,
false
,
true
,
false
)
highlight
(
fragmentAddWord
.
view
!!
.
word
)
}
if
(
item
.
itemId
==
R
.
id
.
sortByWord
)
{
if
(
item
.
itemId
==
R
.
id
.
sortByTranslation
)
vocabularyAdapter
.
sortOrder
=
SORT_BY_TRANSLATION
hideMenuItem
(
optionsMenu
,
false
,
false
,
true
)
transparent
(
fragmentAddWord
.
view
!!
.
word
)
highlight
(
fragmentAddWord
.
view
!!
.
translation
)
}
if
(
item
.
itemId
==
R
.
id
.
sortByTranslation
)
{
vocabularyAdapter
.
sortOrder
=
SORT_BY_TIME
hideMenuItem
(
optionsMenu
,
true
,
false
,
false
)
transparent
(
fragmentAddWord
.
view
!!
.
translation
)
}
return
super
.
onOptionsItemSelected
(
item
)
}
...
...
app/src/main/java/com/paktalin/vocabularynotebook/utils/ActivityUtil.kt
View file @
38c1cff9
...
...
@@ -59,18 +59,4 @@ fun invisible(view: View) {
fun
gone
(
view
:
View
)
{
view
.
visibility
=
View
.
GONE
}
fun
hideMenuItem
(
menu
:
Menu
,
time
:
Boolean
,
word
:
Boolean
,
translation
:
Boolean
)
{
menu
.
findItem
(
R
.
id
.
sortByTime
).
isVisible
=
time
menu
.
findItem
(
R
.
id
.
sortByWord
).
isVisible
=
word
menu
.
findItem
(
R
.
id
.
sortByTranslation
).
isVisible
=
translation
}
fun
highlight
(
view
:
View
)
{
view
.
setBackgroundResource
(
R
.
color
.
green_highlight
)
}
fun
transparent
(
view
:
View
)
{
view
.
setBackgroundResource
(
android
.
R
.
color
.
transparent
)
}
\ No newline at end of file
app/src/main/res/drawable/ic_sort
_az
.xml
→
app/src/main/res/drawable/ic_sort.xml
View file @
38c1cff9
...
...
@@ -5,5 +5,5 @@
android:viewportHeight=
"24"
>
<path
android:fillColor=
"#FF000000"
android:pathData=
"M
14.94,4.66h-4.72l2.36,-2.36zM10.25,19.37h4.66l-2.33,2.33zM6.1,6.27L1.6,17.73h1.84l0.92,-2.45h5.11l0.92,2.45h1.84L7.74,6.27L6.1,6.27zM4.97,13.64l1.94,-5.18 1.94,5.18L4.97,13.64zM15.73,16.14h6.12v1.59h-8.53v-1.29l5.92,-8.56h-5.88v-1.6h8.3v1.26l-5.93,8.6
z"
/>
android:pathData=
"M
3,18h6v-2L3,16v2zM3,6v2h18L21,6L3,6zM3,13h12v-2L3,11v2
z"
/>
</vector>
app/src/main/res/drawable/ic_time.xml
deleted
100644 → 0
View file @
8807a572
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"24dp"
android:height=
"24dp"
android:viewportWidth=
"24"
android:viewportHeight=
"24"
>
<path
android:fillColor=
"#FF000000"
android:pathData=
"M11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM12,20c-4.42,0 -8,-3.58 -8,-8s3.58,-8 8,-8 8,3.58 8,8 -3.58,8 -8,8z"
/>
<path
android:fillColor=
"#FF000000"
android:pathData=
"M12.5,7H11v6l5.25,3.15 0.75,-1.23 -4.5,-2.67z"
/>
</vector>
app/src/main/res/drawable/marker.png
deleted
100644 → 0
View file @
8807a572
7.99 KB
app/src/main/res/drawable/marker_green.png
deleted
100644 → 0
View file @
8807a572
2.65 KB
app/src/main/res/layout/fragment_editable_word.xml
View file @
38c1cff9
...
...
@@ -44,7 +44,7 @@
android:inputType=
"text"
android:textSize=
"22sp"
app:fontFamily=
"@font/neucha"
android:textColor=
"
#000F55
"
android:textColor=
"
@color/text_color
"
tools:ignore=
"LabelFor"
/>
<EditText
...
...
@@ -57,7 +57,7 @@
android:inputType=
"text"
android:textSize=
"22sp"
app:fontFamily=
"@font/neucha"
android:textColor=
"
#000F55
"
android:textColor=
"
@color/text_color
"
tools:ignore=
"LabelFor"
/>
</LinearLayout>
...
...
app/src/main/res/layout/word_item.xml
View file @
38c1cff9
...
...
@@ -42,7 +42,7 @@
android:layout_weight=
"1"
android:textSize=
"22sp"
app:fontFamily=
"@font/neucha"
android:textColor=
"
#000F55
"
android:textColor=
"
@color/text_color
"
tools:ignore=
"LabelFor"
/>
<TextView
...
...
@@ -52,7 +52,7 @@
android:layout_weight=
"1"
android:textSize=
"22sp"
app:fontFamily=
"@font/neucha"
android:textColor=
"
#000F55
"
android:textColor=
"
@color/text_color
"
tools:ignore=
"LabelFor"
/>
</LinearLayout>
...
...
app/src/main/res/menu/options_menu.xml
View file @
38c1cff9
...
...
@@ -2,28 +2,26 @@
<menu
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
>
<item
android:id=
"@+id/search"
android:
title=
"@string/option_
search"
<item
android:
id=
"@+id/
search"
android:icon=
"@drawable/ic_search_icon"
app:showAsAction=
"ifRoom|collapseActionView"
app:actionViewClass=
"android.support.v7.widget.SearchView"
/>
android:title=
"@string/option_search"
app:actionViewClass=
"android.support.v7.widget.SearchView"
app:showAsAction=
"ifRoom|collapseActionView"
/>
<item
android:id=
"@+id/sortByTime"
android:title=
"@string/option_sort"
android:icon=
"@drawable/ic_time"
app:showAsAction=
"always"
/>
android:id=
"@+id/sortByTime"
android:title=
"@string/sort_by_time"
app:showAsAction=
"never"
/>
<item
android:id=
"@+id/sortByWord"
android:title=
"@string/option_sort"
android:icon=
"@drawable/ic_sort_az"
app:showAsAction=
"always"
/>
android:title=
"@string/sort_by_word"
app:showAsAction=
"never"
/>
<item
android:id=
"@+id/sortByTranslation"
android:title=
"@string/option_sort"
android:icon=
"@drawable/ic_sort_az"
app:showAsAction=
"always"
/>
android:title=
"@string/sort_by_translation"
app:showAsAction=
"never"
/>
</menu>
\ No newline at end of file
app/src/main/res/values/colors.xml
View file @
38c1cff9
...
...
@@ -5,4 +5,5 @@
<color
name=
"colorAccent"
>
#FF4081
</color>
<color
name=
"sheet_color"
>
#FAFAFA
</color>
<color
name=
"green_highlight"
>
#69B578
</color>
<color
name=
"text_color"
>
#000F55
</color>
</resources>
app/src/main/res/values/strings.xml
View file @
38c1cff9
...
...
@@ -13,7 +13,9 @@
<string
name=
"hint_translation"
>
translation
</string>
<string
name=
"menu_option_delete"
>
Delete
</string>
<string
name=
"menu_option_edit"
>
Edit
</string>
<string
name=
"option_sort"
>
Sort
</string>
<string
name=
"sort_by_time"
>
Sort by time
</string>
<string
name=
"sort_by_word"
>
Sort by word
</string>
<string
name=
"sort_by_translation"
>
Sort by translation
</string>
<string
name=
"option_search"
>
Search
</string>
<!--Toast messages-->
...
...
app/src/main/res/values/styles.xml
View file @
38c1cff9
...
...
@@ -7,6 +7,7 @@
<item
name=
"actionBarStyle"
>
@style/Widget.Styled.ActionBar
</item>
<item
name=
"android:actionBarStyle"
>
@style/Widget.Styled.ActionBar
</item>
<item
name=
"android:actionOverflowButtonStyle"
>
@style/MyActionButtonOverflow
</item>
</style>
<style
name=
"Widget.Styled.ActionBar"
parent=
"Widget.AppCompat.Light.ActionBar.Solid.Inverse"
>
...
...
@@ -14,4 +15,9 @@
<item
name=
"displayOptions"
>
showHome|useLogo
</item>
</style>
<style
name=
"MyActionButtonOverflow"
parent=
"android:style/Widget.Holo.Light.ActionButton.Overflow"
>
<item
name=
"android:src"
>
@drawable/ic_sort
</item>
<item
name=
"android:background"
>
?android:attr/actionBarItemBackground
</item>
</style>
</resources>
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