Fix some crashes
This commit is contained in:
parent
3cbc8339cc
commit
bc9d992158
|
@ -616,14 +616,19 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
public void onClick(View v) {
|
||||
if( type != RetrieveFeedsAsyncTask.Type.CACHE_BOOKMARKS) {
|
||||
status.setBookmarked(!status.isBookmarked());
|
||||
if (status.isBookmarked()) {
|
||||
new StatusCacheDAO(context, db).insertStatus(StatusCacheDAO.BOOKMARK_CACHE, status);
|
||||
Toast.makeText(context, R.string.status_bookmarked, Toast.LENGTH_LONG).show();
|
||||
} else {
|
||||
new StatusCacheDAO(context, db).remove(StatusCacheDAO.BOOKMARK_CACHE, status);
|
||||
Toast.makeText(context, R.string.status_unbookmarked, Toast.LENGTH_LONG).show();
|
||||
try {
|
||||
if (status.isBookmarked()) {
|
||||
new StatusCacheDAO(context, db).insertStatus(StatusCacheDAO.BOOKMARK_CACHE, status);
|
||||
Toast.makeText(context, R.string.status_bookmarked, Toast.LENGTH_LONG).show();
|
||||
} else {
|
||||
new StatusCacheDAO(context, db).remove(StatusCacheDAO.BOOKMARK_CACHE, status);
|
||||
Toast.makeText(context, R.string.status_unbookmarked, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
notifyStatusChanged(status);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
Toast.makeText(context, R.string.toast_error, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
notifyStatusChanged(status);
|
||||
}else {
|
||||
int position = 0;
|
||||
for (Status statustmp : statuses) {
|
||||
|
|
|
@ -122,7 +122,7 @@ public class SettingsFragment extends Fragment {
|
|||
});
|
||||
|
||||
|
||||
boolean enabledCrash = sharedpreferences.getBoolean(ACRA.PREF_ENABLE_ACRA, true);
|
||||
boolean enabledCrash = sharedpreferences.getBoolean(ACRA.PREF_ENABLE_ACRA, false);
|
||||
final CheckBox set_crash_report = rootView.findViewById(R.id.set_crash_report);
|
||||
set_crash_report.setChecked(enabledCrash);
|
||||
set_crash_report.setOnClickListener(new View.OnClickListener() {
|
||||
|
|
|
@ -237,17 +237,29 @@
|
|||
android:minHeight="20dp"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:textSize="16sp"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="match_parent" />
|
||||
<TextView
|
||||
android:id="@+id/value1"
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:layout_weight="2"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
android:id="@+id/value1BG"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:id="@+id/value1"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:id="@+id/field2"
|
||||
|
@ -257,21 +269,33 @@
|
|||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:id="@+id/label2"
|
||||
android:padding="5dp"
|
||||
android:padding="10dp"
|
||||
android:minHeight="20dp"
|
||||
android:layout_width="0dp"
|
||||
android:textSize="16sp"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="match_parent" />
|
||||
<TextView
|
||||
android:id="@+id/value2"
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:layout_weight="2"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
android:id="@+id/value2BG"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:id="@+id/value2"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:id="@+id/field3"
|
||||
|
@ -281,21 +305,31 @@
|
|||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:id="@+id/label3"
|
||||
android:padding="5dp"
|
||||
android:padding="10dp"
|
||||
android:minHeight="20dp"
|
||||
android:textSize="16sp"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:layout_height="match_parent" />
|
||||
<TextView
|
||||
android:id="@+id/value3"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="2"
|
||||
android:layout_height="match_parent" />
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/value3BG"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:id="@+id/value3"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:id="@+id/field4"
|
||||
|
@ -305,21 +339,32 @@
|
|||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:id="@+id/label4"
|
||||
android:padding="5dp"
|
||||
android:padding="10dp"
|
||||
android:minHeight="20dp"
|
||||
android:textSize="16sp"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:layout_width="0dp"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="match_parent" />
|
||||
<TextView
|
||||
android:id="@+id/value4"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="2"
|
||||
android:layout_height="match_parent" />
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/value4BG"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:id="@+id/value4"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<!-- End Fields container -->
|
||||
|
|
Loading…
Reference in New Issue