Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Add call phone feature #3

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions app/src/main/java/com/samsao/sandbox/MainActivity.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
package com.samsao.sandbox;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import butterknife.ButterKnife;
import butterknife.OnClick;

public class MainActivity extends AppCompatActivity {

Expand All @@ -14,4 +17,10 @@ protected void onCreate(Bundle savedInstanceState) {

ButterKnife.bind(this);
}

@OnClick(R.id.main_telephone_button)
void onTelephoneButtonClick() {
Intent intent = new Intent(Intent.ACTION_DIAL, Uri.fromParts("tel", "5144321234", null));
startActivity(intent);
}
}
20 changes: 13 additions & 7 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/double_spacing"
android:orientation="vertical"
tools:context="com.samsao.sandbox.MainActivity">
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="@dimen/double_spacing"
tools:context="com.samsao.sandbox.MainActivity">

<Button
android:id="@+id/main_maps_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Maps"/>

<Button
android:id="@+id/main_telephone_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Call telephone"/>

</LinearLayout>
6 changes: 4 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@
buildscript {
repositories {
jcenter()
google()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should keep google repo from now on...

}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deprecated, we passed everything to KAPT


// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
jcenter()
google()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should keep google repo from now on...

}
}

Expand Down