mirror of
https://github.com/afollestad/nock-nock.git
synced 2025-04-20 03:25:14 +00:00
One more 0.1.0.1 build. Misc fixes.
This commit is contained in:
parent
f119e07422
commit
a25c0baee2
6 changed files with 14 additions and 3 deletions
Binary file not shown.
|
@ -8,7 +8,7 @@ android {
|
|||
applicationId "com.afollestad.nocknock"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 24
|
||||
versionCode 4
|
||||
versionCode 5
|
||||
versionName "0.1.0.1"
|
||||
|
||||
jackOptions {
|
||||
|
|
|
@ -86,6 +86,11 @@ public class ServerAdapter extends RecyclerView.Adapter<ServerAdapter.ServerVH>
|
|||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
mServers.clear();
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServerAdapter.ServerVH onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
final View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_item_server, parent, false);
|
||||
|
|
|
@ -150,7 +150,8 @@ public class MainActivity extends AppCompatActivity implements SwipeRefreshLayou
|
|||
}
|
||||
|
||||
private void refreshModels() {
|
||||
mEmptyText.setVisibility(View.GONE);
|
||||
mAdapter.clear();
|
||||
mEmptyText.setVisibility(View.VISIBLE);
|
||||
Inquiry.get()
|
||||
.selectFrom(SITES_TABLE_NAME, ServerModel.class)
|
||||
.all(this::setModels);
|
||||
|
@ -280,7 +281,10 @@ public class MainActivity extends AppCompatActivity implements SwipeRefreshLayou
|
|||
if (which == 0) {
|
||||
checkSite(MainActivity.this, model);
|
||||
} else {
|
||||
removeSite(MainActivity.this, model, () -> mAdapter.remove(index));
|
||||
removeSite(MainActivity.this, model, () -> {
|
||||
mAdapter.remove(index);
|
||||
mEmptyText.setVisibility(mAdapter.getItemCount() == 0 ? View.VISIBLE : View.GONE);
|
||||
});
|
||||
}
|
||||
}).show();
|
||||
} else {
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginBottom="@dimen/content_inset"
|
||||
android:fontFamily="sans-serif-light"
|
||||
android:gravity="center"
|
||||
android:text="@string/no_sites_added"
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
<a href=\'https://google.com/+AidanFollestad\'>Google+</a>
|
||||
<a href=\'https://github.com/afollestad\'>GitHub</a>
|
||||
<a href=\'https://www.linkedin.com/in/afollestad\'>LinkedIn</a>
|
||||
<br/><i>Nock Nock is open source! Check out the <a href=\'https://github.com/afollestad/nock-nock\'>GitHub page</a>!</i>
|
||||
]]></string>
|
||||
<string name="dismiss">Dismiss</string>
|
||||
<string name="add_site">Add Site</string>
|
||||
|
|
Loading…
Add table
Reference in a new issue