mirror of
https://github.com/afollestad/nock-nock.git
synced 2025-08-06 07:58:39 +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"
|
applicationId "com.afollestad.nocknock"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 24
|
targetSdkVersion 24
|
||||||
versionCode 4
|
versionCode 5
|
||||||
versionName "0.1.0.1"
|
versionName "0.1.0.1"
|
||||||
|
|
||||||
jackOptions {
|
jackOptions {
|
||||||
|
|
|
@ -86,6 +86,11 @@ public class ServerAdapter extends RecyclerView.Adapter<ServerAdapter.ServerVH>
|
||||||
notifyDataSetChanged();
|
notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void clear() {
|
||||||
|
mServers.clear();
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ServerAdapter.ServerVH onCreateViewHolder(ViewGroup parent, int viewType) {
|
public ServerAdapter.ServerVH onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||||
final View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_item_server, parent, false);
|
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() {
|
private void refreshModels() {
|
||||||
mEmptyText.setVisibility(View.GONE);
|
mAdapter.clear();
|
||||||
|
mEmptyText.setVisibility(View.VISIBLE);
|
||||||
Inquiry.get()
|
Inquiry.get()
|
||||||
.selectFrom(SITES_TABLE_NAME, ServerModel.class)
|
.selectFrom(SITES_TABLE_NAME, ServerModel.class)
|
||||||
.all(this::setModels);
|
.all(this::setModels);
|
||||||
|
@ -280,7 +281,10 @@ public class MainActivity extends AppCompatActivity implements SwipeRefreshLayou
|
||||||
if (which == 0) {
|
if (which == 0) {
|
||||||
checkSite(MainActivity.this, model);
|
checkSite(MainActivity.this, model);
|
||||||
} else {
|
} 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();
|
}).show();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
|
android:layout_marginBottom="@dimen/content_inset"
|
||||||
android:fontFamily="sans-serif-light"
|
android:fontFamily="sans-serif-light"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="@string/no_sites_added"
|
android:text="@string/no_sites_added"
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
<a href=\'https://google.com/+AidanFollestad\'>Google+</a>
|
<a href=\'https://google.com/+AidanFollestad\'>Google+</a>
|
||||||
<a href=\'https://github.com/afollestad\'>GitHub</a>
|
<a href=\'https://github.com/afollestad\'>GitHub</a>
|
||||||
<a href=\'https://www.linkedin.com/in/afollestad\'>LinkedIn</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>
|
||||||
<string name="dismiss">Dismiss</string>
|
<string name="dismiss">Dismiss</string>
|
||||||
<string name="add_site">Add Site</string>
|
<string name="add_site">Add Site</string>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue