Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fallenstardust
YGOMobile
Commits
5f03ee56
Commit
5f03ee56
authored
Oct 06, 2021
by
kenan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SearchableListDialog
parent
cf816b81
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
113 additions
and
206 deletions
+113
-206
mobile/src/main/java/cn/garymb/ygomobile/ui/adapters/SimpleSpinnerItem.java
...va/cn/garymb/ygomobile/ui/adapters/SimpleSpinnerItem.java
+5
-2
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/CardSearcher.java
.../main/java/cn/garymb/ygomobile/ui/cards/CardSearcher.java
+4
-2
mobile/src/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
...c/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
+9
-6
mobile/src/main/java/cn/garymb/ygomobile/ui/widget/SearchableListDialog.java
...a/cn/garymb/ygomobile/ui/widget/SearchableListDialog.java
+59
-147
mobile/src/main/java/cn/garymb/ygomobile/ui/widget/SearchableSpinner.java
...java/cn/garymb/ygomobile/ui/widget/SearchableSpinner.java
+32
-49
mobile/src/main/res/values/colors.xml
mobile/src/main/res/values/colors.xml
+3
-0
mobile/src/main/res/values/strings.xml
mobile/src/main/res/values/strings.xml
+1
-0
No files found.
mobile/src/main/java/cn/garymb/ygomobile/ui/adapters/SimpleSpinnerItem.java
View file @
5f03ee56
package
cn.garymb.ygomobile.ui.adapters
;
import
androidx.annotation.NonNull
;
public
class
SimpleSpinnerItem
{
public
long
value
;
public
String
text
;
public
Object
tag
;
public
transient
Object
tag
;
public
SimpleSpinnerItem
(
long
value
,
String
text
)
{
this
.
value
=
value
;
...
...
@@ -20,8 +22,9 @@ public class SimpleSpinnerItem {
return
this
;
}
@NonNull
@Override
public
String
toString
()
{
return
text
;
return
""
+
text
;
}
}
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/CardSearcher.java
View file @
5f03ee56
...
...
@@ -26,6 +26,7 @@ import cn.garymb.ygomobile.ui.adapters.SimpleSpinnerAdapter;
import
cn.garymb.ygomobile.ui.adapters.SimpleSpinnerItem
;
import
cn.garymb.ygomobile.ui.plus.DialogPlus
;
import
cn.garymb.ygomobile.ui.plus.VUiKit
;
import
cn.garymb.ygomobile.ui.widget.SearchableSpinner
;
import
ocgcore.DataManager
;
import
ocgcore.LimitManager
;
import
ocgcore.StringManager
;
...
...
@@ -55,7 +56,7 @@ public class CardSearcher implements View.OnClickListener {
private
final
Spinner
typeMonsterSpinner2
;
private
final
Spinner
typeSpellSpinner
;
private
final
Spinner
typeTrapSpinner
;
private
final
Spinner
setCodeSpinner
;
private
final
S
earchableS
pinner
setCodeSpinner
;
private
final
Spinner
categorySpinner
;
private
final
Spinner
raceSpinner
;
private
final
Spinner
levelSpinner
;
...
...
@@ -120,6 +121,7 @@ public class CardSearcher implements View.OnClickListener {
resetButton
.
setOnClickListener
(
this
);
mCardLoader
=
dataLoader
;
// setCodeSpinner.setFirstIndex(1);
OnEditorActionListener
searchListener
=
(
v
,
actionId
,
event
)
->
{
if
(
actionId
==
EditorInfo
.
IME_ACTION_SEARCH
)
{
InputMethodManager
imm
=
(
InputMethodManager
)
mContext
.
getSystemService
(
Context
.
INPUT_METHOD_SERVICE
);
...
...
@@ -439,7 +441,7 @@ public class CardSearcher implements View.OnClickListener {
private
void
initSetNameSpinners
(
Spinner
spinner
)
{
List
<
CardSet
>
setnames
=
mStringManager
.
getCardSets
();
List
<
SimpleSpinnerItem
>
items
=
new
ArrayList
<>();
items
.
add
(
new
SimpleSpinnerItem
(
0
,
getString
(
R
.
string
.
label_set
)));
items
.
add
(
new
SimpleSpinnerItem
(
0
,
mContext
.
getString
(
R
.
string
.
label_set
)));
for
(
CardSet
set
:
setnames
)
{
items
.
add
(
new
SimpleSpinnerItem
(
set
.
getCode
(),
set
.
getName
()));
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
View file @
5f03ee56
...
...
@@ -142,12 +142,15 @@ public abstract class HomeActivity extends BaseActivity implements NavigationVie
};
//x5内核初始化接口
QbSdk
.
initX5Environment
(
this
,
cb
);
if
(!
Constants
.
ACTION_OPEN_GAME
.
equals
(
getIntent
().
getAction
()))
{
Log
.
d
(
Constants
.
TAG
,
"start check update"
);
//check update
Beta
.
checkUpgrade
(
false
,
false
);
}
else
{
Log
.
d
(
Constants
.
TAG
,
"skip check update"
);
if
(!
BuildConfig
.
BUILD_TYPE
.
equals
(
"debug"
))
{
//release才检查版本
if
(!
Constants
.
ACTION_OPEN_GAME
.
equals
(
getIntent
().
getAction
()))
{
Log
.
d
(
Constants
.
TAG
,
"start check update"
);
//check update
Beta
.
checkUpgrade
(
false
,
false
);
}
else
{
Log
.
d
(
Constants
.
TAG
,
"skip check update"
);
}
}
//初始化决斗助手
initDuelAssistant
();
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/widget/SearchableListDialog.java
View file @
5f03ee56
package
cn.garymb.ygomobile.ui.widget
;
import
android.app.Dialog
;
import
android.app.DialogFragment
;
import
android.app.Activity
;
import
android.app.SearchManager
;
import
android.content.Context
;
import
android.content.DialogInterface
;
import
android.graphics.Color
;
import
android.os.Bundle
;
import
android.text.TextUtils
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.view.WindowManager
;
import
android.view.inputmethod.InputMethodManager
;
import
android.widget.AdapterView
;
import
android.widget.ArrayAdapter
;
import
android.widget.ListView
;
import
android.widget.SearchView
;
import
android.widget.TextView
;
import
java.
io.Serializable
;
import
java.
util.ArrayList
;
import
java.util.List
;
import
cn.garymb.ygomobile.lite.R
;
import
cn.garymb.ygomobile.ui.plus.DialogPlus
;
public
class
SearchableListDialog
extends
Dialog
Fragment
implements
public
class
SearchableListDialog
extends
Dialog
Plus
implements
SearchView
.
OnQueryTextListener
,
SearchView
.
OnCloseListener
{
private
static
final
String
ITEMS
=
"items"
;
private
ArrayAdapter
listAdapter
;
private
ListView
_listViewItems
;
private
SearchableItem
_searchableItem
;
private
final
ArrayAdapter
<
Object
>
listAdapter
;
private
onSearchItemClickListener
_onSearchItemClickListener
;
private
OnSearchTextChanged
_onSearchTextChanged
;
private
final
SearchView
_searchView
;
private
final
List
<
Object
>
items
=
new
ArrayList
<>();
private
SearchView
_searchView
;
private
String
_strTitle
;
private
String
_strPositiveButtonText
;
private
DialogInterface
.
OnClickListener
_onClickListener
;
public
SearchableListDialog
()
{
}
public
static
SearchableListDialog
newInstance
(
List
items
)
{
SearchableListDialog
multiSelectExpandableFragment
=
new
SearchableListDialog
();
Bundle
args
=
new
Bundle
();
args
.
putSerializable
(
ITEMS
,
(
Serializable
)
items
);
multiSelectExpandableFragment
.
setArguments
(
args
);
return
multiSelectExpandableFragment
;
}
@Override
public
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
}
@Override
public
View
onCreateView
(
LayoutInflater
inflater
,
ViewGroup
container
,
Bundle
savedInstanceState
)
{
getDialog
().
getWindow
().
setSoftInputMode
(
WindowManager
.
LayoutParams
.
SOFT_INPUT_STATE_HIDDEN
);
return
super
.
onCreateView
(
inflater
,
container
,
savedInstanceState
);
}
@Override
public
Dialog
onCreateDialog
(
Bundle
savedInstanceState
)
{
// Getting the layout inflater to inflate the view in an alert dialog.
LayoutInflater
inflater
=
LayoutInflater
.
from
(
getActivity
());
// Crash on orientation change #7
// Change Start
// Description: As the instance was re initializing to null on rotating the device,
// getting the instance from the saved instance
if
(
null
!=
savedInstanceState
)
{
_searchableItem
=
(
SearchableItem
)
savedInstanceState
.
getSerializable
(
"item"
);
}
// Change End
public
SearchableListDialog
(
Context
context
)
{
super
(
context
);
LayoutInflater
inflater
=
LayoutInflater
.
from
(
context
);
View
rootView
=
inflater
.
inflate
(
R
.
layout
.
searchable_list_dialog
,
null
);
setData
(
rootView
);
DialogPlus
alertDialog
=
new
DialogPlus
(
getActivity
());
alertDialog
.
setContentView
(
rootView
);
alertDialog
.
hideButton
();
String
strTitle
=
_strTitle
==
null
?
"Select Item"
:
_strTitle
;
alertDialog
.
setTitle
(
strTitle
);
alertDialog
.
show
();
alertDialog
.
getWindow
().
setSoftInputMode
(
WindowManager
.
LayoutParams
.
SOFT_INPUT_STATE_HIDDEN
);
return
alertDialog
;
}
// Crash on orientation change #7
// Change Start
// Description: Saving the instance of searchable item instance.
@Override
public
void
onSaveInstanceState
(
Bundle
outState
)
{
outState
.
putSerializable
(
"item"
,
_searchableItem
);
super
.
onSaveInstanceState
(
outState
);
}
// Change End
public
void
setTitle
(
String
strTitle
)
{
_strTitle
=
strTitle
;
}
public
void
setPositiveButton
(
String
strPositiveButtonText
)
{
_strPositiveButtonText
=
strPositiveButtonText
;
}
public
void
setPositiveButton
(
String
strPositiveButtonText
,
DialogInterface
.
OnClickListener
onClickListener
)
{
_strPositiveButtonText
=
strPositiveButtonText
;
_onClickListener
=
onClickListener
;
}
public
void
setOnSearchableItemClickListener
(
SearchableItem
searchableItem
)
{
this
.
_searchableItem
=
searchableItem
;
}
public
void
setOnSearchTextChangedListener
(
OnSearchTextChanged
onSearchTextChanged
)
{
this
.
_onSearchTextChanged
=
onSearchTextChanged
;
}
private
void
setData
(
View
rootView
)
{
SearchManager
searchManager
=
(
SearchManager
)
getActivity
().
getSystemService
(
Context
.
SEARCH_SERVICE
);
SearchManager
searchManager
=
(
SearchManager
)
context
.
getSystemService
(
Context
.
SEARCH_SERVICE
);
_searchView
=
(
SearchView
)
rootView
.
findViewById
(
R
.
id
.
search
);
_searchView
.
setSearchableInfo
(
searchManager
.
getSearchableInfo
(
getActivity
().
getComponentName
()));
if
(
context
instanceof
Activity
)
{
_searchView
.
setSearchableInfo
(
searchManager
.
getSearchableInfo
(((
Activity
)
context
).
getComponentName
()));
}
_searchView
.
setIconifiedByDefault
(
false
);
_searchView
.
setOnQueryTextListener
(
this
);
_searchView
.
setOnCloseListener
(
this
);
_searchView
.
clearFocus
();
int
id
=
_searchView
.
getContext
().
getResources
().
getIdentifier
(
"android:id/search_src_text"
,
null
,
null
);
TextView
textView1
=
(
TextView
)
_searchView
.
findViewById
(
id
);
textView1
.
setTextColor
(
Color
.
parseColor
(
"#ff8800"
));
InputMethodManager
mgr
=
(
InputMethodManager
)
getActivity
().
getSystemService
(
Context
.
INPUT_METHOD_SERVICE
);
mgr
.
hideSoftInputFromWindow
(
_searchView
.
getWindowToken
(),
0
);
List
items
=
(
List
)
getArguments
().
getSerializable
(
ITEMS
);
_listViewItems
=
(
ListView
)
rootView
.
findViewById
(
R
.
id
.
listItems
);
if
(
textView1
!=
null
)
{
textView1
.
setTextColor
(
getContext
().
getResources
().
getColor
(
R
.
color
.
search_text_color
));
}
ListView
_listViewItems
=
(
ListView
)
rootView
.
findViewById
(
R
.
id
.
listItems
);
//create the adapter by passing your ArrayList data
/*listAdapter = new ArrayAdapter(getActivity(), android.R.layout.simple_list_item_1,
items);*/
listAdapter
=
new
ArrayAdapter
<
String
>(
getActivity
(),
android
.
R
.
layout
.
simple_list_item_1
,
items
)
{
listAdapter
=
new
ArrayAdapter
<
Object
>(
context
,
android
.
R
.
layout
.
simple_list_item_1
,
items
)
{
@Override
public
View
getView
(
int
position
,
View
convertView
,
ViewGroup
parent
)
{
TextView
textView
=
(
TextView
)
super
.
getView
(
position
,
convertView
,
parent
);
textView
.
setTextColor
(
Color
.
parseColor
(
"#b8be35"
));
textView
.
setTextColor
(
getContext
().
getResources
().
getColor
(
R
.
color
.
search_list_item_color
));
return
textView
;
}
};
//attach the adapter to the list
_listViewItems
.
setAdapter
(
listAdapter
);
_listViewItems
.
setTextFilterEnabled
(
true
);
_listViewItems
.
setOnItemClickListener
(
new
AdapterView
.
OnItemClickListener
()
{
@Override
public
void
onItemClick
(
AdapterView
<?>
parent
,
View
view
,
int
position
,
long
id
)
{
_searchableItem
.
onSearchableItemClicked
(
listAdapter
.
getItem
(
position
),
position
);
getDialog
().
dismiss
();
_listViewItems
.
setOnItemClickListener
((
parent
,
view
,
position
,
id1
)
->
{
if
(
_onSearchItemClickListener
!=
null
)
{
_onSearchItemClickListener
.
onSearchableItemClicked
(
listAdapter
.
getItem
(
position
),
position
);
}
this
.
dismiss
();
});
setContentView
(
rootView
);
hideButton
();
}
@Override
public
void
show
()
{
super
.
show
();
getWindow
().
setSoftInputMode
(
WindowManager
.
LayoutParams
.
SOFT_INPUT_STATE_HIDDEN
);
}
public
void
show
(
List
<
Object
>
items
){
//隐藏输入法
InputMethodManager
mgr
=
(
InputMethodManager
)
getContext
().
getSystemService
(
Context
.
INPUT_METHOD_SERVICE
);
mgr
.
hideSoftInputFromWindow
(
_searchView
.
getWindowToken
(),
0
);
//设置列表
this
.
items
.
clear
();
this
.
items
.
addAll
(
items
);
listAdapter
.
notifyDataSetChanged
();
show
();
}
public
void
setOnSearchableItemClickListener
(
onSearchItemClickListener
onSearchItemClickListener
)
{
this
.
_onSearchItemClickListener
=
onSearchItemClickListener
;
}
public
void
setOnSearchTextChangedListener
(
OnSearchTextChanged
onSearchTextChanged
)
{
this
.
_onSearchTextChanged
=
onSearchTextChanged
;
}
@Override
...
...
@@ -198,12 +112,10 @@ public class SearchableListDialog extends DialogFragment implements
@Override
public
boolean
onQueryTextChange
(
String
s
)
{
// listAdapter.filterData(s);
if
(
TextUtils
.
isEmpty
(
s
))
{
// _listViewItems.clearTextFilter();
((
ArrayAdapter
)
_listViewItems
.
getAdapter
()).
getFilter
().
filter
(
null
);
listAdapter
.
getFilter
().
filter
(
null
);
}
else
{
((
ArrayAdapter
)
_listViewItems
.
getAdapter
())
.
getFilter
().
filter
(
s
);
listAdapter
.
getFilter
().
filter
(
s
);
}
if
(
null
!=
_onSearchTextChanged
)
{
_onSearchTextChanged
.
onSearchTextChanged
(
s
);
...
...
@@ -211,8 +123,8 @@ public class SearchableListDialog extends DialogFragment implements
return
true
;
}
public
interface
SearchableItem
<
T
>
extends
Serializable
{
void
onSearchableItemClicked
(
T
item
,
int
position
);
public
interface
onSearchItemClickListener
{
void
onSearchableItemClicked
(
Object
item
,
int
position
);
}
public
interface
OnSearchTextChanged
{
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/widget/SearchableSpinner.java
View file @
5f03ee56
...
...
@@ -3,7 +3,6 @@ package cn.garymb.ygomobile.ui.widget;
import
android.app.Activity
;
import
android.content.Context
;
import
android.content.ContextWrapper
;
import
android.content.DialogInterface
;
import
android.content.res.TypedArray
;
import
android.text.TextUtils
;
import
android.util.AttributeSet
;
...
...
@@ -16,88 +15,81 @@ import android.widget.SpinnerAdapter;
import
androidx.appcompat.widget.AppCompatSpinner
;
import
java.util.ArrayList
;
import
java.util.List
;
import
cn.garymb.ygomobile.lite.R
;
public
class
SearchableSpinner
extends
AppCompatSpinner
implements
View
.
OnTouchListener
,
SearchableListDialog
.
SearchableItem
{
SearchableListDialog
.
onSearchItemClickListener
{
public
static
final
int
NO_ITEM_SELECTED
=
-
1
;
private
Context
_context
;
private
List
_items
;
private
SearchableListDialog
_searchableListDialog
;
private
final
ArrayList
<
Object
>
_items
=
new
ArrayList
<>();
private
boolean
_isDirty
;
private
BaseAdapter
_arrayAdapter
;
private
String
_strHintText
;
private
boolean
_isFromInit
;
private
String
mTitleString
=
"Select Item"
;
private
int
mFirstIndex
=
0
;
public
SearchableSpinner
(
Context
context
)
{
super
(
context
);
this
.
_context
=
context
;
init
();
this
(
context
,
null
);
}
public
SearchableSpinner
(
Context
context
,
AttributeSet
attrs
)
{
super
(
context
,
attrs
);
this
.
_context
=
context
;
TypedArray
a
=
context
.
obtainStyledAttributes
(
attrs
,
R
.
styleable
.
SearchableSpinner
);
final
int
N
=
a
.
getIndexCount
();
for
(
int
i
=
0
;
i
<
N
;
++
i
)
{
int
attr
=
a
.
getIndex
(
i
);
if
(
attr
==
R
.
styleable
.
SearchableSpinner_hintText
)
{
_strHintText
=
a
.
getString
(
attr
);
}
else
if
(
attr
==
R
.
styleable
.
SearchableSpinner_searchTitle
)
{
mTitleString
=
a
.
getString
(
attr
);
}
}
a
.
recycle
();
init
();
this
(
context
,
attrs
,
0
);
}
public
SearchableSpinner
(
Context
context
,
AttributeSet
attrs
,
int
defStyleAttr
)
{
super
(
context
,
attrs
,
defStyleAttr
);
this
.
_context
=
context
;
TypedArray
a
=
context
.
obtainStyledAttributes
(
attrs
,
R
.
styleable
.
SearchableSpinner
);
if
(
a
!=
null
)
{
final
int
N
=
a
.
getIndexCount
();
for
(
int
i
=
0
;
i
<
N
;
++
i
)
{
int
attr
=
a
.
getIndex
(
i
);
if
(
attr
==
R
.
styleable
.
SearchableSpinner_hintText
)
{
_strHintText
=
a
.
getString
(
attr
);
}
else
if
(
attr
==
R
.
styleable
.
SearchableSpinner_searchTitle
)
{
mTitleString
=
a
.
getString
(
attr
);
}
}
a
.
recycle
();
}
init
();
}
private
void
init
()
{
_items
=
new
ArrayList
();
_searchableListDialog
=
SearchableListDialog
.
newInstance
(
_items
);
_searchableListDialog
=
new
SearchableListDialog
(
getContext
());
_searchableListDialog
.
setTitle
(
mTitleString
);
_searchableListDialog
.
setOnSearchableItemClickListener
(
this
);
setOnTouchListener
(
this
);
_arrayAdapter
=
(
BaseAdapter
)
getAdapter
();
if
(!
TextUtils
.
isEmpty
(
_strHintText
))
{
ArrayAdapter
arrayAdapter
=
new
ArrayAdapter
(
_context
,
android
.
R
.
layout
.
simple_list_item_1
,
new
String
[]{
_strHintText
});
ArrayAdapter
<
String
>
arrayAdapter
=
new
ArrayAdapter
<>(
getContext
(),
android
.
R
.
layout
.
simple_list_item_1
,
new
String
[]{
_strHintText
});
_isFromInit
=
true
;
setAdapter
(
arrayAdapter
);
}
}
public
void
setFirstIndex
(
int
firstIndex
)
{
this
.
mFirstIndex
=
firstIndex
;
}
@Override
public
boolean
onTouch
(
View
v
,
MotionEvent
event
)
{
if
(
event
.
getAction
()
==
MotionEvent
.
ACTION_UP
)
{
if
(
null
!=
_arrayAdapter
)
{
// Refresh content #6
// Change Start
// Description: The items were only set initially, not reloading the data in the
// spinner every time it is loaded with items in the adapter.
// Change end.
//修复 重复点击 bug
if
(!
_searchableListDialog
.
isAdded
())
{
if
(!
_searchableListDialog
.
isShowing
())
{
_items
.
clear
();
for
(
int
i
=
0
;
i
<
_arrayAdapter
.
getCount
();
i
++)
{
int
N
=
_arrayAdapter
.
getCount
();
for
(
int
i
=
mFirstIndex
;
i
<
N
;
i
++)
{
_items
.
add
(
_arrayAdapter
.
getItem
(
i
));
}
_searchableListDialog
.
show
(
scanForActivity
(
_context
).
getFragmentManager
(),
"TAG"
);
_searchableListDialog
.
show
(
_items
);
}
}
}
...
...
@@ -109,7 +101,7 @@ public class SearchableSpinner extends AppCompatSpinner implements View.OnTouchL
if
(!
_isFromInit
)
{
_arrayAdapter
=
(
BaseAdapter
)
adapter
;
if
(!
TextUtils
.
isEmpty
(
_strHintText
)
&&
!
_isDirty
)
{
ArrayAdapter
arrayAdapter
=
new
ArrayAdapter
(
_context
,
android
.
R
.
layout
ArrayAdapter
<
String
>
arrayAdapter
=
new
ArrayAdapter
<>(
getContext
()
,
android
.
R
.
layout
.
simple_list_item_1
,
new
String
[]{
_strHintText
});
super
.
setAdapter
(
arrayAdapter
);
}
else
{
...
...
@@ -124,8 +116,7 @@ public class SearchableSpinner extends AppCompatSpinner implements View.OnTouchL
@Override
public
void
onSearchableItemClicked
(
Object
item
,
int
position
)
{
setSelection
(
_items
.
indexOf
(
item
));
setSelection
(
_items
.
indexOf
(
item
)
+
mFirstIndex
);
if
(!
_isDirty
)
{
_isDirty
=
true
;
setAdapter
(
_arrayAdapter
);
...
...
@@ -137,14 +128,6 @@ public class SearchableSpinner extends AppCompatSpinner implements View.OnTouchL
_searchableListDialog
.
setTitle
(
strTitle
);
}
public
void
setPositiveButton
(
String
strPositiveButtonText
)
{
_searchableListDialog
.
setPositiveButton
(
strPositiveButtonText
);
}
public
void
setPositiveButton
(
String
strPositiveButtonText
,
DialogInterface
.
OnClickListener
onClickListener
)
{
_searchableListDialog
.
setPositiveButton
(
strPositiveButtonText
,
onClickListener
);
}
public
void
setOnSearchTextChangedListener
(
SearchableListDialog
.
OnSearchTextChanged
onSearchTextChanged
)
{
_searchableListDialog
.
setOnSearchTextChangedListener
(
onSearchTextChanged
);
}
...
...
mobile/src/main/res/values/colors.xml
View file @
5f03ee56
...
...
@@ -29,4 +29,7 @@
<color
name=
"colorMain"
>
#2196F3
</color>
<color
name=
"background"
>
#ECEFF1
</color>
<color
name=
"transparent"
>
#00000000
</color>
<color
name=
"search_text_color"
>
#ff8800
</color>
<color
name=
"search_list_item_color"
>
#b8be35
</color>
</resources>
\ No newline at end of file
mobile/src/main/res/values/strings.xml
View file @
5f03ee56
...
...
@@ -328,4 +328,5 @@
<string
name=
"label_ot_SC_OCG"
>
SChinese OCG
</string>
<string
name=
"settings_screen_padding"
>
Reserved height of curved screen
</string>
<string
name=
"tip_load_cdb_error"
>
加载数据出错
</string>
<string
name=
"text_none"
translatable=
"false"
>
N/A
</string>
</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