Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
YuanWenHai committed Nov 4, 2016
2 parents e709e27 + e79e01b commit bcf7c0b
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ Add it in your root build.gradle at the end of repositories:
Step 2. Add the dependency

dependencies {
compile 'com.github.YuanWenHai:FileSearcher:1.0'
compile 'com.github.YuanWenHai:FileSearcher:1.1'
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public int getItemCount() {

@Override
public FSViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(context).inflate(R.layout.item,parent,false);
View view = LayoutInflater.from(context).inflate(R.layout.file_searcher_item,parent,false);
return new FSViewHolder(view);
}

Expand All @@ -86,8 +86,8 @@ class FSViewHolder extends RecyclerView.ViewHolder{
CheckBox checkBox;
FSViewHolder(View view){
super(view);
text = (TextView) view.findViewById(R.id.item_text);
checkBox = (CheckBox) view.findViewById(R.id.item_check_box);
text = (TextView) view.findViewById(R.id.file_searcher_item_text);
checkBox = (CheckBox) view.findViewById(R.id.file_searcher_item_check_box);
text.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ public class FileSearcherActivity extends AppCompatActivity {
@Override
protected void onCreate( Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.main_recycler_view);
TextView text = (TextView) findViewById(R.id.main_text);
setContentView(R.layout.file_searcher_main);
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.file_searcher_main_recycler_view);
TextView text = (TextView) findViewById(R.id.file_searcher_main_text);
mAdapter = new FSAdapter(this,text);
recyclerView.setAdapter(mAdapter);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
Expand All @@ -42,7 +42,7 @@ protected void onCreate( Bundle savedInstanceState) {
}
mAdapter.startSearch(Environment.getExternalStorageDirectory(),keyword);

Toolbar toolbar = (Toolbar) findViewById(R.id.main_toolbar);
Toolbar toolbar = (Toolbar) findViewById(R.id.file_searcher_main_toolbar);
toolbar.setTitle("");
toolbar.setNavigationIcon(R.drawable.ic_arrow_back_white_24dp);
setSupportActionBar(toolbar);
Expand Down Expand Up @@ -78,7 +78,7 @@ public void onBackPressed() {

@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.toolbar_menu,menu);
getMenuInflater().inflate(R.menu.file_searcher_toolbar_menu,menu);
return true;
}

Expand All @@ -87,7 +87,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
if(mAdapter.isSearching()){
return true;
}
if(item.getItemId() == R.id.toolbar_menu_done){
if(item.getItemId() == R.id.file_searcher_toolbar_menu_done){
ArrayList<File> selectedData = (ArrayList<File>) mAdapter.getSelectedItems();
if(selectedData.size() == 0){
setResult(NO_DATA_SELECTED);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/item_text"
android:id="@+id/file_searcher_item_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
Expand All @@ -18,7 +18,7 @@
android:textColor="@color/black"
tools:text="abcde.text"/>
<CheckBox
android:id="@+id/item_check_box"
android:id="@+id/file_searcher_item_check_box"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@
<android.support.v7.widget.Toolbar
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:id="@+id/main_toolbar"
android:id="@+id/file_searcher_main_toolbar"
app:contentInsetStart="0dp"
android:background="?attr/colorPrimary">
<TextView
android:id="@+id/main_text"
android:id="@+id/file_searcher_main_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"

android:maxLines="1"
android:textColor="#ffffff"
android:textColor="?attr/actionMenuTextColor"
android:textSize="18sp"
tools:text="正在搜索目录: abcde"/>
</android.support.v7.widget.Toolbar>

<android.support.v7.widget.RecyclerView
android:id="@+id/main_recycler_view"
android:id="@+id/file_searcher_main_recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbars="vertical"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:title="@string/select_all"
android:id="@+id/toolbar_menu_select_all"
android:id="@+id/file_searcher_toolbar_menu_select_all"
android:icon="@drawable/ic_select_all_white_24dp"
app:showAsAction="ifRoom"/>
<item
android:title="@string/done"
android:id="@+id/toolbar_menu_done"
android:id="@+id/file_searcher_toolbar_menu_done"
android:icon="@drawable/ic_done_white_24dp"
app:showAsAction="ifRoom"/>
</menu>
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
<color name="black">#333333</color>
<color name="white">#ffffff</color>
</resources>
1 change: 1 addition & 0 deletions filesearcher/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:windowTranslucentStatus">true</item>
<item name="actionMenuTextColor">@color/white</item>
</style>

</resources>

0 comments on commit bcf7c0b

Please sign in to comment.