move bottom sheet from fragments to activities (#628)
* move bottom sheet from fragments to activities * move BottomSheetLogic to dedicated abstract Activity * change tests * improve code
This commit is contained in:
parent
1c711eca22
commit
a2bfef3101
23 changed files with 421 additions and 296 deletions
|
|
@ -34,10 +34,17 @@ import com.keylesspalace.tusky.db.AccountEntity;
|
|||
import com.keylesspalace.tusky.db.AccountManager;
|
||||
import com.keylesspalace.tusky.util.ThemeUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import retrofit2.Call;
|
||||
|
||||
public abstract class BaseActivity extends AppCompatActivity {
|
||||
|
||||
protected List<Call> callList;
|
||||
|
||||
@Inject
|
||||
public AccountManager accountManager;
|
||||
|
||||
|
|
@ -75,6 +82,9 @@ public abstract class BaseActivity extends AppCompatActivity {
|
|||
getTheme().applyStyle(style, false);
|
||||
|
||||
redirectIfNotLoggedIn();
|
||||
|
||||
callList = new ArrayList<>();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -162,4 +172,12 @@ public abstract class BaseActivity extends AppCompatActivity {
|
|||
.build()
|
||||
.scheduleAsync();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
for (Call call : callList) {
|
||||
call.cancel();
|
||||
}
|
||||
super.onDestroy();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue