2019-11-14 14:35:08 -05:00
|
|
|
package org.thoughtcrime.securesms;
|
|
|
|
|
2020-08-13 16:39:43 -03:00
|
|
|
import android.content.Intent;
|
|
|
|
import android.net.Uri;
|
2019-11-14 14:35:08 -05:00
|
|
|
import android.os.Bundle;
|
|
|
|
|
|
|
|
import androidx.annotation.NonNull;
|
|
|
|
|
2020-08-13 16:39:43 -03:00
|
|
|
import org.thoughtcrime.securesms.util.CommunicationActions;
|
2019-11-14 14:35:08 -05:00
|
|
|
import org.thoughtcrime.securesms.util.DynamicNoActionBarTheme;
|
|
|
|
import org.thoughtcrime.securesms.util.DynamicTheme;
|
|
|
|
|
2020-06-22 17:01:40 -07:00
|
|
|
public class MainActivity extends PassphraseRequiredActivity {
|
2019-11-14 14:35:08 -05:00
|
|
|
|
|
|
|
private final DynamicTheme dynamicTheme = new DynamicNoActionBarTheme();
|
|
|
|
private final MainNavigator navigator = new MainNavigator(this);
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void onCreate(Bundle savedInstanceState, boolean ready) {
|
|
|
|
super.onCreate(savedInstanceState, ready);
|
|
|
|
setContentView(R.layout.main_activity);
|
|
|
|
|
|
|
|
navigator.onCreate(savedInstanceState);
|
2020-08-13 16:39:43 -03:00
|
|
|
|
|
|
|
handleGroupLinkInIntent(getIntent());
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void onNewIntent(Intent intent) {
|
|
|
|
super.onNewIntent(intent);
|
|
|
|
handleGroupLinkInIntent(intent);
|
2019-11-14 14:35:08 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void onPreCreate() {
|
|
|
|
super.onPreCreate();
|
|
|
|
dynamicTheme.onCreate(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void onResume() {
|
|
|
|
super.onResume();
|
|
|
|
dynamicTheme.onResume(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onBackPressed() {
|
|
|
|
if (!navigator.onBackPressed()) {
|
|
|
|
super.onBackPressed();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public @NonNull MainNavigator getNavigator() {
|
|
|
|
return navigator;
|
|
|
|
}
|
2020-08-13 16:39:43 -03:00
|
|
|
|
|
|
|
private void handleGroupLinkInIntent(Intent intent) {
|
|
|
|
Uri data = intent.getData();
|
|
|
|
if (data != null) {
|
|
|
|
CommunicationActions.handlePotentialGroupLinkUrl(this, data.toString());
|
|
|
|
}
|
|
|
|
}
|
2019-11-14 14:35:08 -05:00
|
|
|
}
|