From 58ed8aef78247aae2a824b0c9c7e701177110d86 Mon Sep 17 00:00:00 2001 From: ChronosX88 Date: Mon, 29 Apr 2019 20:44:00 +0400 Subject: [PATCH] Remove Start chat fragment, replaced with EditTextDialog (Floating Action Button) --- .../influence/contracts/CoreContracts.kt | 2 + .../chronosx88/influence/logic/MainLogic.java | 85 +++++++++++++- .../influence/logic/StartChatLogic.java | 110 ------------------ .../influence/presenters/MainPresenter.kt | 35 +++++- .../presenters/StartChatPresenter.java | 49 -------- .../influence/views/MainActivity.java | 39 +++++-- .../chronosx88/influence/views/ViewUtils.kt | 42 +++++++ .../views/fragments/StartChatFragment.java | 69 ----------- .../main/res/drawable/ic_add_white_24dp.xml | 22 ++++ app/src/main/res/layout/activity_main.xml | 43 ++++--- .../main/res/layout/start_chat_fragment.xml | 33 ------ .../main/res/menu/main_bottom_nav_menu.xml | 4 - app/src/main/res/values-ru-rRU/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 14 files changed, 242 insertions(+), 293 deletions(-) delete mode 100644 app/src/main/java/io/github/chronosx88/influence/logic/StartChatLogic.java delete mode 100644 app/src/main/java/io/github/chronosx88/influence/presenters/StartChatPresenter.java create mode 100644 app/src/main/java/io/github/chronosx88/influence/views/ViewUtils.kt delete mode 100644 app/src/main/java/io/github/chronosx88/influence/views/fragments/StartChatFragment.java create mode 100644 app/src/main/res/drawable/ic_add_white_24dp.xml delete mode 100644 app/src/main/res/layout/start_chat_fragment.xml diff --git a/app/src/main/java/io/github/chronosx88/influence/contracts/CoreContracts.kt b/app/src/main/java/io/github/chronosx88/influence/contracts/CoreContracts.kt index 4764bad..99d3a76 100644 --- a/app/src/main/java/io/github/chronosx88/influence/contracts/CoreContracts.kt +++ b/app/src/main/java/io/github/chronosx88/influence/contracts/CoreContracts.kt @@ -46,11 +46,13 @@ interface CoreContracts { interface IMainLogicContract { fun initPeer() + fun sendStartChatMessage(username: String) fun shutdownPeer() } interface IMainPresenterContract { fun initPeer() + fun startChatWithPeer(username: String) fun onDestroy() } diff --git a/app/src/main/java/io/github/chronosx88/influence/logic/MainLogic.java b/app/src/main/java/io/github/chronosx88/influence/logic/MainLogic.java index 2d13188..460afd1 100644 --- a/app/src/main/java/io/github/chronosx88/influence/logic/MainLogic.java +++ b/app/src/main/java/io/github/chronosx88/influence/logic/MainLogic.java @@ -22,11 +22,14 @@ import net.tomp2p.nat.PeerBuilderNAT; import net.tomp2p.nat.PeerNAT; import net.tomp2p.p2p.PeerBuilder; import net.tomp2p.peers.Number160; +import net.tomp2p.peers.Number640; import net.tomp2p.peers.PeerAddress; import net.tomp2p.relay.tcp.TCPRelayClientConfig; import net.tomp2p.replication.IndirectReplication; import net.tomp2p.storage.Data; +import org.jetbrains.annotations.NotNull; + import java.io.File; import java.io.IOException; import java.net.Inet4Address; @@ -34,6 +37,8 @@ import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.UnknownHostException; import java.security.KeyPair; +import java.util.ArrayList; +import java.util.Map; import java.util.Timer; import java.util.TimerTask; import java.util.UUID; @@ -42,10 +47,14 @@ import io.github.chronosx88.influence.contracts.CoreContracts; import io.github.chronosx88.influence.helpers.AppHelper; import io.github.chronosx88.influence.helpers.JVMShutdownHook; import io.github.chronosx88.influence.helpers.KeyPairManager; +import io.github.chronosx88.influence.helpers.LocalDBWrapper; import io.github.chronosx88.influence.helpers.NetworkHandler; +import io.github.chronosx88.influence.helpers.ObservableUtils; import io.github.chronosx88.influence.helpers.P2PUtils; import io.github.chronosx88.influence.helpers.StorageBerkeleyDB; import io.github.chronosx88.influence.helpers.actions.UIActions; +import io.github.chronosx88.influence.models.ChatMetadata; +import io.github.chronosx88.influence.models.NewChatRequestMessage; import io.github.chronosx88.influence.models.PublicUserProfile; public class MainLogic implements CoreContracts.IMainLogicContract { @@ -236,8 +245,10 @@ public class MainLogic implements CoreContracts.IMainLogicContract { if(replication != null) { replication.shutdown(); } - peerDHT.peer().announceShutdown().start().awaitUninterruptibly(); - peerDHT.peer().shutdown().awaitUninterruptibly(); + if(peerDHT != null) { + peerDHT.peer().announceShutdown().start().awaitUninterruptibly(); + peerDHT.peer().shutdown().awaitUninterruptibly(); + } storage.close(); System.exit(0); }).start(); @@ -292,4 +303,74 @@ public class MainLogic implements CoreContracts.IMainLogicContract { channelServerConfiguration.byteBufPool(false); return channelServerConfiguration; } + + @Override + public void sendStartChatMessage(@NotNull String username) { + if(AppHelper.getPeerDHT() == null) { + ObservableUtils.notifyUI(UIActions.NODE_IS_OFFLINE); + return; + } + + String companionPeerID = getPeerIDByUsername(username); + if(companionPeerID == null) { + ObservableUtils.notifyUI(UIActions.PEER_NOT_EXIST); + return; + } + PublicUserProfile recipientPublicProfile = getPublicProfile(companionPeerID); + if(recipientPublicProfile == null) { + ObservableUtils.notifyUI(UIActions.PEER_NOT_EXIST); + return; + } + + NewChatRequestMessage newChatRequestMessage = new NewChatRequestMessage(UUID.randomUUID().toString(), UUID.randomUUID().toString(), AppHelper.getPeerID(), AppHelper.getUsername(), System.currentTimeMillis(), 0); + try { + if(P2PUtils.put(companionPeerID + "_pendingChats", newChatRequestMessage.getChatID(), new Data(gson.toJson(newChatRequestMessage)))) { + Log.i(LOG_TAG, "# Create new offline chat request is successful! ChatID: " + newChatRequestMessage.getChatID()); + } else { + Log.e(LOG_TAG, "# Failed to create offline chat request. ChatID: " + newChatRequestMessage.getChatID()); + } + } catch (IOException e) { + e.printStackTrace(); + } + + ArrayList admins = new ArrayList<>(); + admins.add(AppHelper.getPeerID()); + Data data = null; + try { + data = new Data(gson.toJson(new ChatMetadata(username, admins, new ArrayList<>()))); + } catch (IOException e) { + e.printStackTrace(); + } + data.protectEntry(keyPairManager.openMainKeyPair()); + P2PUtils.put(newChatRequestMessage.getChatID() + "_metadata", null, data); + LocalDBWrapper.createChatEntry(newChatRequestMessage.getChatID(), username, newChatRequestMessage.getChatID() + "_metadata", newChatRequestMessage.getChatID() + "_members", 0); + ObservableUtils.notifyUI(UIActions.NEW_CHAT); + } + + private PublicUserProfile getPublicProfile(String peerID) { + PublicUserProfile publicProfile = null; + Map data = P2PUtils.get(peerID + "_profile"); + if (data != null && data.size() == 1) { + try { + publicProfile = gson.fromJson((String) data.values().iterator().next().object(), PublicUserProfile.class); + } catch (ClassNotFoundException | IOException e) { + e.printStackTrace(); + } + return publicProfile; + } + return null; + } + + private String getPeerIDByUsername(String username) { + Map usernameMap = P2PUtils.get(username); + if(usernameMap == null) { + return null; + } + try { + return (String) usernameMap.values().iterator().next().object(); + } catch (ClassNotFoundException | IOException e) { + e.printStackTrace(); + } + return null; + } } diff --git a/app/src/main/java/io/github/chronosx88/influence/logic/StartChatLogic.java b/app/src/main/java/io/github/chronosx88/influence/logic/StartChatLogic.java deleted file mode 100644 index 8511a07..0000000 --- a/app/src/main/java/io/github/chronosx88/influence/logic/StartChatLogic.java +++ /dev/null @@ -1,110 +0,0 @@ -package io.github.chronosx88.influence.logic; - -import android.util.Log; - -import com.google.gson.Gson; - -import net.tomp2p.dht.PeerDHT; -import net.tomp2p.peers.Number640; -import net.tomp2p.storage.Data; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Map; -import java.util.UUID; - -import io.github.chronosx88.influence.contracts.CoreContracts; -import io.github.chronosx88.influence.helpers.AppHelper; -import io.github.chronosx88.influence.helpers.KeyPairManager; -import io.github.chronosx88.influence.helpers.LocalDBWrapper; -import io.github.chronosx88.influence.helpers.ObservableUtils; -import io.github.chronosx88.influence.helpers.P2PUtils; -import io.github.chronosx88.influence.helpers.actions.UIActions; -import io.github.chronosx88.influence.models.ChatMetadata; -import io.github.chronosx88.influence.models.NewChatRequestMessage; -import io.github.chronosx88.influence.models.PublicUserProfile; - -public class StartChatLogic implements CoreContracts.IStartChatLogicContract { - private PeerDHT peerDHT; - private Gson gson; - private KeyPairManager keyPairManager; - private final static String LOG_TAG = "StartChatLogic"; - - public StartChatLogic() { - peerDHT = AppHelper.getPeerDHT(); - gson = new Gson(); - keyPairManager = new KeyPairManager(); - } - - @Override - public void sendStartChatMessage(String username) { - if(peerDHT == null) { - ObservableUtils.notifyUI(UIActions.NODE_IS_OFFLINE); - return; - } - - new Thread(() -> { - String peerID = getPeerIDByUsername(username); - if(peerID == null) { - ObservableUtils.notifyUI(UIActions.PEER_NOT_EXIST); - return; - } - PublicUserProfile recipientPublicProfile = getPublicProfile(peerID); - if(recipientPublicProfile == null) { - ObservableUtils.notifyUI(UIActions.PEER_NOT_EXIST); - return; - } - - NewChatRequestMessage newChatRequestMessage = new NewChatRequestMessage(UUID.randomUUID().toString(), UUID.randomUUID().toString(), AppHelper.getPeerID(), AppHelper.getUsername(), System.currentTimeMillis(), 0); - try { - if(P2PUtils.put(peerID + "_pendingChats", newChatRequestMessage.getChatID(), new Data(gson.toJson(newChatRequestMessage)))) { - Log.i(LOG_TAG, "# Create new offline chat request is successful! ChatID: " + newChatRequestMessage.getChatID()); - } else { - Log.e(LOG_TAG, "# Failed to create offline chat request. ChatID: " + newChatRequestMessage.getChatID()); - } - } catch (IOException e) { - e.printStackTrace(); - } - - ArrayList admins = new ArrayList<>(); - admins.add(AppHelper.getPeerID()); - Data data = null; - try { - data = new Data(gson.toJson(new ChatMetadata(username, admins, new ArrayList<>()))); - } catch (IOException e) { - e.printStackTrace(); - } - data.protectEntry(keyPairManager.openMainKeyPair()); - P2PUtils.put(newChatRequestMessage.getChatID() + "_metadata", null, data); - LocalDBWrapper.createChatEntry(newChatRequestMessage.getChatID(), username, newChatRequestMessage.getChatID() + "_metadata", newChatRequestMessage.getChatID() + "_members", 0); - ObservableUtils.notifyUI(UIActions.NEW_CHAT); - }).start(); - } - - private PublicUserProfile getPublicProfile(String peerID) { - PublicUserProfile publicProfile = null; - Map data = P2PUtils.get(peerID + "_profile"); - if (data != null && data.size() == 1) { - try { - publicProfile = gson.fromJson((String) data.values().iterator().next().object(), PublicUserProfile.class); - } catch (ClassNotFoundException | IOException e) { - e.printStackTrace(); - } - return publicProfile; - } - return null; - } - - private String getPeerIDByUsername(String username) { - Map usernameMap = P2PUtils.get(username); - if(usernameMap == null) { - return null; - } - try { - return (String) usernameMap.values().iterator().next().object(); - } catch (ClassNotFoundException | IOException e) { - e.printStackTrace(); - } - return null; - } -} diff --git a/app/src/main/java/io/github/chronosx88/influence/presenters/MainPresenter.kt b/app/src/main/java/io/github/chronosx88/influence/presenters/MainPresenter.kt index 73ab727..6db7273 100644 --- a/app/src/main/java/io/github/chronosx88/influence/presenters/MainPresenter.kt +++ b/app/src/main/java/io/github/chronosx88/influence/presenters/MainPresenter.kt @@ -1,13 +1,21 @@ package io.github.chronosx88.influence.presenters +import com.google.gson.JsonObject import io.github.chronosx88.influence.R import io.github.chronosx88.influence.contracts.CoreContracts +import io.github.chronosx88.influence.contracts.observer.IObserver import io.github.chronosx88.influence.helpers.AppHelper +import io.github.chronosx88.influence.helpers.actions.UIActions import io.github.chronosx88.influence.logic.MainLogic +import org.jetbrains.anko.doAsync -class MainPresenter(private val view: CoreContracts.IMainViewContract) : CoreContracts.IMainPresenterContract { +class MainPresenter(private val view: CoreContracts.IMainViewContract) : CoreContracts.IMainPresenterContract, IObserver { private val logic: CoreContracts.IMainLogicContract = MainLogic() + init { + AppHelper.getObservable().register(this) + } + override fun initPeer() { if (AppHelper.getPeerDHT() == null) { logic.initPeer() @@ -17,6 +25,31 @@ class MainPresenter(private val view: CoreContracts.IMainViewContract) : CoreCon } } + override fun startChatWithPeer(username: String) { + doAsync { + logic.sendStartChatMessage(username) + } + } + + override fun handleEvent(obj: JsonObject) { + when(obj.get("action").asInt) { + UIActions.PEER_NOT_EXIST -> { + view.showProgressBar(false) + view.showSnackbar("Данный узел не существует!") + } + + UIActions.NEW_CHAT -> { + view.showProgressBar(false) + view.showSnackbar("Чат успешно создан!") + } + + UIActions.NODE_IS_OFFLINE -> { + view.showProgressBar(false) + view.showSnackbar("Нода не запущена!") + } + } + } + override fun onDestroy() { logic.shutdownPeer() } diff --git a/app/src/main/java/io/github/chronosx88/influence/presenters/StartChatPresenter.java b/app/src/main/java/io/github/chronosx88/influence/presenters/StartChatPresenter.java deleted file mode 100644 index 555ad7b..0000000 --- a/app/src/main/java/io/github/chronosx88/influence/presenters/StartChatPresenter.java +++ /dev/null @@ -1,49 +0,0 @@ -package io.github.chronosx88.influence.presenters; - -import com.google.gson.JsonObject; - -import io.github.chronosx88.influence.contracts.CoreContracts; -import io.github.chronosx88.influence.contracts.observer.IObserver; -import io.github.chronosx88.influence.helpers.AppHelper; -import io.github.chronosx88.influence.helpers.actions.UIActions; -import io.github.chronosx88.influence.logic.StartChatLogic; - -public class StartChatPresenter implements CoreContracts.IStartChatPresenterContract, IObserver { - private CoreContracts.IStartChatViewContract view; - private CoreContracts.IStartChatLogicContract logic; - - public StartChatPresenter(CoreContracts.IStartChatViewContract view) { - this.view = view; - this.logic = new StartChatLogic(); - AppHelper.getObservable().register(this); - } - - @Override - public void startChatWithPeer(String peerID) { - view.showProgressDialog(true); - logic.sendStartChatMessage(peerID); - } - - @Override - public void handleEvent(JsonObject object) { - switch (object.get("action").getAsInt()) { - case UIActions.PEER_NOT_EXIST: { - view.showProgressDialog(false); - view.showMessage("Данный узел не существует!"); - break; - } - - case UIActions.NEW_CHAT: { - view.showProgressDialog(false); - view.showMessage("Чат успешно создан!"); - break; - } - - case UIActions.NODE_IS_OFFLINE: { - view.showProgressDialog(false); - view.showMessage("Нода не запущена!"); - break; - } - } - } -} diff --git a/app/src/main/java/io/github/chronosx88/influence/views/MainActivity.java b/app/src/main/java/io/github/chronosx88/influence/views/MainActivity.java index 90db9f3..4a54544 100644 --- a/app/src/main/java/io/github/chronosx88/influence/views/MainActivity.java +++ b/app/src/main/java/io/github/chronosx88/influence/views/MainActivity.java @@ -6,13 +6,16 @@ import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; +import android.widget.EditText; import android.widget.Toast; import com.google.android.material.bottomnavigation.BottomNavigationView; +import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.google.android.material.snackbar.Snackbar; import com.google.gson.JsonObject; import androidx.annotation.NonNull; +import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentTransaction; @@ -27,7 +30,7 @@ import io.github.chronosx88.influence.helpers.actions.UIActions; import io.github.chronosx88.influence.presenters.MainPresenter; import io.github.chronosx88.influence.views.fragments.ChatListFragment; import io.github.chronosx88.influence.views.fragments.SettingsFragment; -import io.github.chronosx88.influence.views.fragments.StartChatFragment; +import kotlin.Pair; public class MainActivity extends AppCompatActivity implements IObserver, CoreContracts.IMainViewContract { @@ -48,9 +51,6 @@ public class MainActivity extends AppCompatActivity implements IObserver, CoreCo case R.id.action_settings: selectedFragment = new SettingsFragment(); break; - case R.id.action_start_chat: - selectedFragment = new StartChatFragment(); - break; } FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); @@ -69,6 +69,19 @@ public class MainActivity extends AppCompatActivity implements IObserver, CoreCo BottomNavigationView navigation = findViewById(R.id.main_bottom_navigation); navigation.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener); + FloatingActionButton fab = findViewById(R.id.add_chat); + fab.setOnClickListener((v) -> { + Pair pair = ViewUtils.INSTANCE.setupEditTextDialog(MainActivity.this, getString(R.string.input_companion_username)); + pair.getFirst().setPositiveButton(getString(R.string.ok), (dialog, which) -> { + progressDialog.show(); + presenter.startChatWithPeer(pair.getSecond().getText().toString()); + }); + pair.getFirst().setNegativeButton(getString(R.string.cancel), (dialog, which) -> { + dialog.cancel(); + }); + pair.getFirst().show(); + }); + getSupportFragmentManager() .beginTransaction() .replace(R.id.main_fragment_container, new ChatListFragment()) @@ -155,17 +168,21 @@ public class MainActivity extends AppCompatActivity implements IObserver, CoreCo @Override public void showSnackbar(@NotNull String message) { - Snackbar.make(getRootView(), message, Snackbar.LENGTH_LONG) - .show(); + runOnUiThread(() -> { + Snackbar.make(getRootView(), message, Snackbar.LENGTH_LONG) + .show(); + }); } @Override public void showProgressBar(boolean state) { - if(state) { - progressDialog.show(); - } else { - progressDialog.dismiss(); - } + runOnUiThread(() -> { + if(state) { + progressDialog.show(); + } else { + progressDialog.dismiss(); + } + }); } private View getRootView() { diff --git a/app/src/main/java/io/github/chronosx88/influence/views/ViewUtils.kt b/app/src/main/java/io/github/chronosx88/influence/views/ViewUtils.kt new file mode 100644 index 0000000..d27d377 --- /dev/null +++ b/app/src/main/java/io/github/chronosx88/influence/views/ViewUtils.kt @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2019 ChronosX88 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package io.github.chronosx88.influence.views + +import android.content.Context +import android.widget.EditText +import android.widget.LinearLayout +import androidx.appcompat.app.AlertDialog +import io.github.chronosx88.influence.R + +object ViewUtils { + fun setupEditTextDialog(context: Context, message: String): Pair { + val alertDialog = AlertDialog.Builder(context) + alertDialog.setTitle(message) + + val input = EditText(context) + val lp = LinearLayout.LayoutParams( + LinearLayout.LayoutParams.MATCH_PARENT, + LinearLayout.LayoutParams.MATCH_PARENT) + input.setSingleLine() + input.layoutParams = lp + + alertDialog.setView(input) + + return Pair(alertDialog, input) + } +} \ No newline at end of file diff --git a/app/src/main/java/io/github/chronosx88/influence/views/fragments/StartChatFragment.java b/app/src/main/java/io/github/chronosx88/influence/views/fragments/StartChatFragment.java deleted file mode 100644 index a75463a..0000000 --- a/app/src/main/java/io/github/chronosx88/influence/views/fragments/StartChatFragment.java +++ /dev/null @@ -1,69 +0,0 @@ -package io.github.chronosx88.influence.views.fragments; - -import android.app.ProgressDialog; -import android.os.Bundle; -import android.os.Handler; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.Button; - -import com.google.android.material.snackbar.Snackbar; -import com.google.android.material.textfield.TextInputLayout; - -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.coordinatorlayout.widget.CoordinatorLayout; -import androidx.fragment.app.Fragment; -import io.github.chronosx88.influence.R; -import io.github.chronosx88.influence.contracts.CoreContracts; -import io.github.chronosx88.influence.presenters.StartChatPresenter; - -public class StartChatFragment extends Fragment implements CoreContracts.IStartChatViewContract { - private TextInputLayout textInputPeerID; - private ProgressDialog progressDialog; - private Button createChatButton; - private StartChatPresenter presenter; - private Handler mainThreadHandler; - private CoordinatorLayout coordinatorLayout; - - @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { - return inflater.inflate(R.layout.start_chat_fragment, container, false); - } - - @Override - public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { - super.onViewCreated(view, savedInstanceState); - presenter = new StartChatPresenter(this); - textInputPeerID = view.findViewById(R.id.textInputPeerID); - progressDialog = new ProgressDialog(getActivity(), R.style.AlertDialogTheme); - progressDialog.setCancelable(false); - progressDialog.setProgressStyle(android.R.style.Widget_ProgressBar_Small); - createChatButton = view.findViewById(R.id.create_chat_button); - createChatButton.setOnClickListener((v) -> { - presenter.startChatWithPeer(textInputPeerID.getEditText().getText().toString()); - }); - mainThreadHandler = new Handler(getContext().getMainLooper()); - coordinatorLayout = getView().findViewById(R.id.start_chat_coordinator); - } - - @Override - public void showMessage(String message) { - mainThreadHandler.post(() -> { - Snackbar.make(coordinatorLayout, message, Snackbar.LENGTH_SHORT).show(); - }); - } - - @Override - public void showProgressDialog(boolean enabled) { - mainThreadHandler.post(() -> { - if(enabled) { - progressDialog.show(); - } else { - progressDialog.dismiss(); - } - }); - } -} diff --git a/app/src/main/res/drawable/ic_add_white_24dp.xml b/app/src/main/res/drawable/ic_add_white_24dp.xml new file mode 100644 index 0000000..c618030 --- /dev/null +++ b/app/src/main/res/drawable/ic_add_white_24dp.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 7bfe822..e062ef9 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -1,5 +1,5 @@ - - + android:layout_height="match_parent" + android:orientation="vertical"> + + + - - \ No newline at end of file + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/start_chat_fragment.xml b/app/src/main/res/layout/start_chat_fragment.xml deleted file mode 100644 index 326d09a..0000000 --- a/app/src/main/res/layout/start_chat_fragment.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - -