Created CallActivity

This commit is contained in:
Pierre HUBERT 2019-02-16 16:13:49 +01:00
parent 2c0867b1bb
commit cb52b20b2a
5 changed files with 71 additions and 2 deletions

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="org.communiquons.android.comunic.client"> package="org.communiquons.android.comunic.client">
<!-- Internet access is required to access the API and download medias --> <!-- Internet access is required to access the API and download medias -->
@ -13,7 +14,8 @@
android:label="@string/app_name" android:label="@string/app_name"
android:roundIcon="@drawable/ic_app_rounded" android:roundIcon="@drawable/ic_app_rounded"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/AppTheme"> android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning">
<!-- Main activity of the application --> <!-- Main activity of the application -->
<activity android:name=".ui.activities.MainActivity"> <activity android:name=".ui.activities.MainActivity">
@ -69,6 +71,11 @@
android:name=".ui.activities.AboutActivity" android:name=".ui.activities.AboutActivity"
android:label="@string/activity_about_title" /> android:label="@string/activity_about_title" />
<!-- Call activity -->
<activity
android:name=".ui.activities.CallActivity"
android:label="@string/activity_call_label"/>
</application> </application>
</manifest> </manifest>

View File

@ -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));
}
}

View File

@ -875,6 +875,10 @@ public class MainActivity extends BaseActivity implements
@Override @Override
public void openCall(int callID) { 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);
} }
} }

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.activities.CallActivity">
<TextView
android:id="@+id/call_id"
android:layout_width="wrap_content"
android:layout_height="21dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:text="TextView"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>

View File

@ -319,4 +319,5 @@
<string name="input_search_hint">Search a user, a group…</string> <string name="input_search_hint">Search a user, a group…</string>
<string name="err_get_search_results">Could not get results of your search!</string> <string name="err_get_search_results">Could not get results of your search!</string>
<string name="err_create_call_for_conversation">Could not create a call for the conversation!</string> <string name="err_create_call_for_conversation">Could not create a call for the conversation!</string>
<string name="activity_call_label">Call</string>
</resources> </resources>