From cb52b20b2ac33c61603fb87f68200d87eeaf8a8e Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sat, 16 Feb 2019 16:13:49 +0100 Subject: [PATCH] Created CallActivity --- app/src/main/AndroidManifest.xml | 9 ++++- .../client/ui/activities/CallActivity.java | 35 +++++++++++++++++++ .../client/ui/activities/MainActivity.java | 6 +++- app/src/main/res/layout/activity_call.xml | 22 ++++++++++++ app/src/main/res/values/strings.xml | 1 + 5 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 app/src/main/java/org/communiquons/android/comunic/client/ui/activities/CallActivity.java create mode 100644 app/src/main/res/layout/activity_call.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 5120c6c..ffa281d 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,5 +1,6 @@ @@ -13,7 +14,8 @@ android:label="@string/app_name" android:roundIcon="@drawable/ic_app_rounded" android:supportsRtl="true" - android:theme="@style/AppTheme"> + android:theme="@style/AppTheme" + tools:ignore="GoogleAppIndexingWarning"> @@ -69,6 +71,11 @@ android:name=".ui.activities.AboutActivity" android:label="@string/activity_about_title" /> + + + \ No newline at end of file diff --git a/app/src/main/java/org/communiquons/android/comunic/client/ui/activities/CallActivity.java b/app/src/main/java/org/communiquons/android/comunic/client/ui/activities/CallActivity.java new file mode 100644 index 0000000..19f92da --- /dev/null +++ b/app/src/main/java/org/communiquons/android/comunic/client/ui/activities/CallActivity.java @@ -0,0 +1,35 @@ +package org.communiquons.android.comunic.client.ui.activities; + +import android.support.v7.app.AppCompatActivity; +import android.os.Bundle; +import android.widget.TextView; + +import org.communiquons.android.comunic.client.R; + +import java.util.Objects; + +/** + * Call activity + * + * @author Pierre HUBERT + */ +public class CallActivity extends AppCompatActivity { + + /** + * Mandatory argument that includes call id + */ + public static final String ARGUMENT_CALL_ID = "call_id"; + + @Override + protected void onCreate(Bundle savedInstanceState) { + + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_call); + + //Hide call bar + Objects.requireNonNull(getSupportActionBar()).hide(); + + ((TextView)findViewById(R.id.call_id)).setText( + "Call " + getIntent().getExtras().getInt(ARGUMENT_CALL_ID)); + } +} diff --git a/app/src/main/java/org/communiquons/android/comunic/client/ui/activities/MainActivity.java b/app/src/main/java/org/communiquons/android/comunic/client/ui/activities/MainActivity.java index e16cf20..3419cb6 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/ui/activities/MainActivity.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/ui/activities/MainActivity.java @@ -875,6 +875,10 @@ public class MainActivity extends BaseActivity implements @Override public void openCall(int callID) { - Log.e(TAG, "Open call " + callID); + + Intent intent = new Intent(this, CallActivity.class); + intent.putExtra(CallActivity.ARGUMENT_CALL_ID, callID); + startActivity(intent); + } } diff --git a/app/src/main/res/layout/activity_call.xml b/app/src/main/res/layout/activity_call.xml new file mode 100644 index 0000000..a409a54 --- /dev/null +++ b/app/src/main/res/layout/activity_call.xml @@ -0,0 +1,22 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 4ed99f9..188ad7d 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -319,4 +319,5 @@ Search a user, a group… Could not get results of your search! Could not create a call for the conversation! + Call