Skip to content
Snippets Groups Projects
Commit bba7658f authored by Adrien Béraud's avatar Adrien Béraud
Browse files

home: use ConversationPath

Change-Id: I95fd875544780046cd6d11e3efbc56dca315ad16
parent 9b11de33
No related branches found
No related tags found
No related merge requests found
...@@ -236,10 +236,8 @@ public class HomeActivity extends AppCompatActivity implements BottomNavigationV ...@@ -236,10 +236,8 @@ public class HomeActivity extends AppCompatActivity implements BottomNavigationV
return; return;
} }
presentTrustRequestFragment(extra.getString(ContactRequestsFragment.ACCOUNT_ID)); presentTrustRequestFragment(extra.getString(ContactRequestsFragment.ACCOUNT_ID));
return;
} else if (Intent.ACTION_SEND.equals(action) || Intent.ACTION_SEND_MULTIPLE.equals(action)) { } else if (Intent.ACTION_SEND.equals(action) || Intent.ACTION_SEND_MULTIPLE.equals(action)) {
handleShareIntent(intent); handleShareIntent(intent);
return;
} else if (Intent.ACTION_SEARCH.equals(action)) { } else if (Intent.ACTION_SEARCH.equals(action)) {
if (fContent instanceof SmartListFragment) { if (fContent instanceof SmartListFragment) {
((SmartListFragment)fContent).handleIntent(intent); ((SmartListFragment)fContent).handleIntent(intent);
...@@ -360,7 +358,7 @@ public class HomeActivity extends AppCompatActivity implements BottomNavigationV ...@@ -360,7 +358,7 @@ public class HomeActivity extends AppCompatActivity implements BottomNavigationV
getSupportFragmentManager() getSupportFragmentManager()
.beginTransaction() .beginTransaction()
.replace(R.id.conversation_container, fConversation, ConversationFragment.class.getName()) .replace(R.id.conversation_container, fConversation, ConversationFragment.class.getSimpleName())
.commit(); .commit();
} }
......
...@@ -810,15 +810,14 @@ public class ConversationFragment extends BaseSupportFragment<ConversationPresen ...@@ -810,15 +810,14 @@ public class ConversationFragment extends BaseSupportFragment<ConversationPresen
@Override @Override
protected void initPresenter(ConversationPresenter presenter) { protected void initPresenter(ConversationPresenter presenter) {
Bundle args = getArguments(); ConversationPath path = ConversationPath.fromBundle(getArguments());
if (args == null) if (path == null)
return; return;
Uri contactUri = new Uri(args.getString(KEY_CONTACT_RING_ID)); Uri contactUri = new Uri(path.getContactId());
String accountId = args.getString(KEY_ACCOUNT_ID);
mAdapter = new ConversationAdapter(this, presenter); mAdapter = new ConversationAdapter(this, presenter);
presenter.init(contactUri, accountId); presenter.init(contactUri, path.getAccountId());
try { try {
mPreferences = requireActivity().getSharedPreferences(accountId + "_" + contactUri.getRawRingId(), Context.MODE_PRIVATE); mPreferences = requireActivity().getSharedPreferences(path.getAccountId() + "_" + contactUri.getRawRingId(), Context.MODE_PRIVATE);
mPreferences.registerOnSharedPreferenceChangeListener(this); mPreferences.registerOnSharedPreferenceChangeListener(this);
presenter.setConversationColor(mPreferences.getInt(KEY_PREFERENCE_CONVERSATION_COLOR, getResources().getColor(R.color.color_primary_light))); presenter.setConversationColor(mPreferences.getInt(KEY_PREFERENCE_CONVERSATION_COLOR, getResources().getColor(R.color.color_primary_light)));
} catch (Exception e) { } catch (Exception e) {
...@@ -834,7 +833,7 @@ public class ConversationFragment extends BaseSupportFragment<ConversationPresen ...@@ -834,7 +833,7 @@ public class ConversationFragment extends BaseSupportFragment<ConversationPresen
LocationSharingService locationService = binder.getService(); LocationSharingService locationService = binder.getService();
ConversationPath path = new ConversationPath(presenter.getPath()); ConversationPath path = new ConversationPath(presenter.getPath());
if (locationService.isSharing(path)) { if (locationService.isSharing(path)) {
showMap(accountId, contactUri.getUri(), false); showMap(path.getAccountId(), contactUri.getUri(), false);
} }
try { try {
requireContext().unbindService(locationServiceConnection); requireContext().unbindService(locationServiceConnection);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment