mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-08-01 03:30:34 +00:00
Fix various crashes. Fixes #850
This commit is contained in:
parent
5bf4b4bb9a
commit
005d8eef05
9 changed files with 15 additions and 17 deletions
|
|
@ -2,7 +2,7 @@
|
|||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="com.habitrpg.android.habitica"
|
||||
android:versionCode="1950"
|
||||
android:versionCode="1951"
|
||||
android:versionName="1.3"
|
||||
android:screenOrientation="portrait"
|
||||
android:installLocation="auto" >
|
||||
|
|
|
|||
|
|
@ -1,13 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<android.support.v4.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scrollbarSize="3dp"
|
||||
android:scrollbarThumbVertical="@color/md_grey_500"
|
||||
|
||||
android:scrollbars="vertical">
|
||||
|
||||
<LinearLayout
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ interface UserRepository : BaseRepository {
|
|||
fun retrieveUser(withTasks: Boolean): Observable<User>
|
||||
fun retrieveUser(withTasks: Boolean = false, forced: Boolean = false): Observable<User>
|
||||
|
||||
fun getInboxMessages(replyToUserID: String): Observable<RealmResults<ChatMessage>>
|
||||
fun getInboxMessages(replyToUserID: String?): Observable<RealmResults<ChatMessage>>
|
||||
|
||||
fun revive(user: User): Observable<User>
|
||||
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ class UserRepositoryImpl(localRepository: UserLocalRepository, apiClient: ApiCli
|
|||
}
|
||||
}
|
||||
|
||||
override fun getInboxMessages(replyToUserID: String): Observable<RealmResults<ChatMessage>> =
|
||||
override fun getInboxMessages(replyToUserID: String?): Observable<RealmResults<ChatMessage>> =
|
||||
localRepository.getInboxMessages(userId, replyToUserID)
|
||||
|
||||
override fun revive(user: User): Observable<User> =
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ interface UserLocalRepository : BaseLocalRepository {
|
|||
|
||||
fun getSpecialItems(user: User): Observable<RealmResults<Skill>>
|
||||
|
||||
fun getInboxMessages(userId: String, replyToUserID: String): Observable<RealmResults<ChatMessage>>
|
||||
fun getInboxMessages(userId: String, replyToUserID: String?): Observable<RealmResults<ChatMessage>>
|
||||
|
||||
fun getInboxOverviewList(userId: String): Observable<RealmResults<ChatMessage>>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ class RealmUserLocalRepository(realm: Realm) : RealmBaseLocalRepository(realm),
|
|||
.filter({ it.isLoaded })
|
||||
}
|
||||
|
||||
override fun getInboxMessages(userId: String, replyToUserID: String): Observable<RealmResults<ChatMessage>> {
|
||||
override fun getInboxMessages(userId: String, replyToUserID: String?): Observable<RealmResults<ChatMessage>> {
|
||||
return realm.where(ChatMessage::class.java)
|
||||
.equalTo("isInboxMessage", true)
|
||||
.equalTo("uuid", replyToUserID)
|
||||
|
|
|
|||
|
|
@ -77,7 +77,6 @@ public abstract class BaseFragment extends DialogFragment {
|
|||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
injectFragment(HabiticaBaseApplication.getComponent());
|
||||
compositeSubscription = new CompositeSubscription();
|
||||
this.setShowsDialog(false);
|
||||
super.onCreate(savedInstanceState);
|
||||
}
|
||||
|
|
@ -85,6 +84,7 @@ public abstract class BaseFragment extends DialogFragment {
|
|||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
compositeSubscription = new CompositeSubscription();
|
||||
|
||||
// Receive Events
|
||||
try {
|
||||
|
|
@ -117,6 +117,9 @@ public abstract class BaseFragment extends DialogFragment {
|
|||
unbinder.unbind();
|
||||
unbinder = null;
|
||||
}
|
||||
if (compositeSubscription != null && !compositeSubscription.isUnsubscribed()) {
|
||||
compositeSubscription.unsubscribe();
|
||||
}
|
||||
|
||||
super.onDestroyView();
|
||||
RefWatcher refWatcher = HabiticaApplication.getInstance(getContext()).refWatcher;
|
||||
|
|
@ -128,9 +131,6 @@ public abstract class BaseFragment extends DialogFragment {
|
|||
if (tutorialRepository != null) {
|
||||
tutorialRepository.close();
|
||||
}
|
||||
if (compositeSubscription != null && !compositeSubscription.isUnsubscribed()) {
|
||||
compositeSubscription.unsubscribe();
|
||||
}
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,8 +30,11 @@ class GroupInformationFragment : BaseFragment() {
|
|||
private var group: Group? = null
|
||||
private var user: User? = null
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
||||
val view = inflater.inflate(R.layout.fragment_group_info, container, false)
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? =
|
||||
inflater.inflate(R.layout.fragment_group_info, container, false)
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
if (user != null) {
|
||||
setUser(user)
|
||||
|
|
@ -69,7 +72,6 @@ class GroupInformationFragment : BaseFragment() {
|
|||
}
|
||||
})
|
||||
|
||||
return view
|
||||
}
|
||||
|
||||
private fun setUser(user: User?) {
|
||||
|
|
|
|||
|
|
@ -56,8 +56,7 @@ public class HabitButtonWidgetProvider extends BaseWidgetProvider {
|
|||
}
|
||||
|
||||
// Build the intent to call the service
|
||||
Intent intent = new Intent(context.getApplicationContext(),
|
||||
HabitButtonWidgetService.class);
|
||||
Intent intent = new Intent(context.getApplicationContext(), HabitButtonWidgetService.class);
|
||||
intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, allWidgetIds);
|
||||
|
||||
context.startService(intent);
|
||||
|
|
|
|||
Loading…
Reference in a new issue