Minor code-style fixes for the tagging implementation

This commit is contained in:
Jakob Nixdorf 2017-11-17 10:29:10 +01:00
parent acf2e592e9
commit ef9b8e0cfe
No known key found for this signature in database
GPG key ID: BE99BF86574A7DBC
4 changed files with 55 additions and 7 deletions

View file

@ -511,6 +511,7 @@ public class MainActivity extends BaseActivity
@Override
public boolean onQueryTextChange(String newText) {
adapter.getFilter().filter(newText);
return false;
}
});
@ -528,10 +529,13 @@ public class MainActivity extends BaseActivity
@Override
public boolean onMenuItemActionCollapse(MenuItem menuItem) {
floatingActionMenu.show();
if (adapter == null || adapter.getSortMode() == SortMode.UNSORTED)
touchHelperCallback.setDragEnabled(true);
if (sortMenu != null)
sortMenu.setVisible(true);
return true;
}
});
@ -577,12 +581,9 @@ public class MainActivity extends BaseActivity
}
private void setupDrawer() {
tagsDrawerListView = (ListView)findViewById(R.id.tags_list_in_drawer);
tagsDrawerListView = findViewById(R.id.tags_list_in_drawer);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
final DrawerLayout tagsDrawerLayout = (DrawerLayout)findViewById(R.id.drawer_layout);
final DrawerLayout tagsDrawerLayout = findViewById(R.id.drawer_layout);
tagsToggle = new ActionBarDrawerToggle(this, tagsDrawerLayout, R.string.drawer_open, R.string.drawer_close) {
@Override
@ -603,8 +604,8 @@ public class MainActivity extends BaseActivity
tagsToggle.setDrawerIndicatorEnabled(true);
tagsDrawerLayout.addDrawerListener(tagsToggle);
final CheckedTextView noTagsButton = (CheckedTextView)findViewById(R.id.no_tags_entries);
final CheckedTextView allTagsButton = (CheckedTextView)findViewById(R.id.all_tags_in_drawer);
final CheckedTextView noTagsButton = findViewById(R.id.no_tags_entries);
final CheckedTextView allTagsButton = findViewById(R.id.all_tags_in_drawer);
allTagsButton.setOnClickListener(new View.OnClickListener() {
@Override

View file

@ -1,3 +1,26 @@
/*
* Copyright (C) 2017 Jakob Nixdorf
* Copyright (C) 2017 RichyHBM
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.shadowice.flocke.andotp.Utilities;
import android.app.AlertDialog;

View file

@ -1,3 +1,26 @@
/*
* Copyright (C) 2017 Jakob Nixdorf
* Copyright (C) 2017 RichyHBM
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.shadowice.flocke.andotp.View;
import android.content.Context;

View file

@ -25,6 +25,7 @@
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:navigationIcon="?homeAsUpIndicator"
app:popupTheme="?attr/actionBarPopupTheme" />
<me.zhanghai.android.materialprogressbar.MaterialProgressBar