├── .gitignore
├── LICENSE
├── README.md
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── ic_launcher-web.png
│ ├── java
│ └── ru
│ │ └── raxee
│ │ └── call_screen
│ │ ├── App.java
│ │ ├── BootReceiver.java
│ │ ├── Call.java
│ │ ├── Contact.java
│ │ ├── MainActivity.java
│ │ ├── PhoneStateReceiver.java
│ │ └── RingingWindow.java
│ └── res
│ ├── drawable
│ ├── ic_call_end_white_24dp.xml
│ ├── ic_call_white_24dp.xml
│ ├── ic_launcher_background.xml
│ └── ic_launcher_foreground.xml
│ ├── layout
│ ├── activity_main.xml
│ └── activity_ringing.xml
│ ├── mipmap-anydpi-v26
│ ├── ic_launcher.xml
│ └── ic_launcher_round.xml
│ ├── mipmap-hdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-mdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xxhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xxxhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ └── values
│ ├── colors.xml
│ ├── strings.xml
│ └── styles.xml
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | .idea
4 | /local.properties
5 | /build
6 | /captures
7 | .externalNativeBuild
8 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Vladislav Yakovlev
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # RaxeeCallScreen
2 | Android custom call screen
3 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 26
5 | buildToolsVersion "26.0.2"
6 | defaultConfig {
7 | applicationId 'ru.raxee.call_screen'
8 | minSdkVersion 26
9 | targetSdkVersion 26
10 | versionCode 1
11 | versionName "1.0"
12 | }
13 | buildTypes {
14 | release {
15 | minifyEnabled false
16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
17 | }
18 | }
19 | productFlavors {
20 | }
21 | }
22 |
23 | dependencies {
24 | compile fileTree(include: ['*.jar'], dir: 'libs')
25 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
26 | exclude group: 'com.android.support', module: 'support-annotations'
27 | })
28 | compile 'com.android.support:appcompat-v7:26.1.0'
29 | compile 'com.android.support.constraint:constraint-layout:1.0.2'
30 | testCompile 'junit:junit:4.12'
31 | compile 'com.android.support:design:26.1.0'
32 | }
33 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/v1ad/Library/Android/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
19 | # Uncomment this to preserve the line number information for
20 | # debugging stack traces.
21 | #-keepattributes SourceFile,LineNumberTable
22 |
23 | # If you keep the line number information, uncomment this to
24 | # hide the original source file name.
25 | #-renamesourcefileattribute SourceFile
26 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/app/src/main/ic_launcher-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vlad-iakovlev/RaxeeCallScreen/fcd514fdafcf84bdad487da91023a326539e1855/app/src/main/ic_launcher-web.png
--------------------------------------------------------------------------------
/app/src/main/java/ru/raxee/call_screen/App.java:
--------------------------------------------------------------------------------
1 | package ru.raxee.call_screen;
2 |
3 | import android.annotation.SuppressLint;
4 | import android.app.Application;
5 | import android.content.Context;
6 |
7 | public class App extends Application {
8 | @SuppressLint("StaticFieldLeak")
9 | private static Context context;
10 |
11 | public void onCreate() {
12 | super.onCreate();
13 | context = getApplicationContext();
14 | context.setTheme(R.style.AppTheme);
15 | }
16 |
17 | public static Context getContext() {
18 | return context;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/app/src/main/java/ru/raxee/call_screen/BootReceiver.java:
--------------------------------------------------------------------------------
1 | package ru.raxee.call_screen;
2 |
3 | import android.content.BroadcastReceiver;
4 | import android.content.Context;
5 | import android.content.Intent;
6 |
7 | public class BootReceiver extends BroadcastReceiver {
8 | @Override
9 | public void onReceive(Context context, Intent intent) {
10 | if (Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) {
11 | Intent serviceIntent = new Intent(context, App.class);
12 | context.startService(serviceIntent);
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/app/src/main/java/ru/raxee/call_screen/Call.java:
--------------------------------------------------------------------------------
1 | package ru.raxee.call_screen;
2 |
3 | import android.annotation.SuppressLint;
4 | import android.content.Context;
5 | import android.telecom.TelecomManager;
6 | import android.telephony.TelephonyManager;
7 |
8 | class Call {
9 | @SuppressLint("StaticFieldLeak")
10 | private static Call instance = null;
11 |
12 | private final Context context;
13 |
14 | private Call() {
15 | context = App.getContext();
16 | }
17 |
18 | static Call getInstance() {
19 | if (instance == null) {
20 | instance = new Call();
21 | }
22 |
23 | return instance;
24 | }
25 |
26 | void answer() {
27 | try {
28 | TelecomManager telecomManager = (TelecomManager) context.getSystemService(Context.TELECOM_SERVICE);
29 | assert telecomManager != null;
30 |
31 | telecomManager.getClass().getMethod("acceptRingingCall").invoke(telecomManager);
32 | } catch (Exception e) {
33 | e.printStackTrace();
34 | }
35 | }
36 |
37 | void dismiss() {
38 | try {
39 | TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
40 | assert telephonyManager != null;
41 |
42 | telephonyManager.getClass().getMethod("endCall").invoke(telephonyManager);
43 | } catch (Exception e) {
44 | e.printStackTrace();
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/app/src/main/java/ru/raxee/call_screen/Contact.java:
--------------------------------------------------------------------------------
1 | package ru.raxee.call_screen;
2 |
3 | import android.content.ContentResolver;
4 | import android.content.ContentUris;
5 | import android.content.Context;
6 | import android.content.res.AssetFileDescriptor;
7 | import android.database.Cursor;
8 | import android.graphics.Bitmap;
9 | import android.graphics.BitmapFactory;
10 | import android.net.Uri;
11 | import android.provider.ContactsContract;
12 | import android.telephony.PhoneNumberUtils;
13 |
14 | class Contact {
15 | private Context context;
16 |
17 | enum Number {HIDDEN, JUST_PHONE, FULL}
18 | Number type = Number.HIDDEN;
19 |
20 | String number = null;
21 | String name = null;
22 | String company = null;
23 | String companyPosition = null;
24 | Bitmap photo = null;
25 |
26 |
27 | Contact(String phoneNumber) {
28 | context = App.getContext();
29 |
30 | try {
31 | setNumber(phoneNumber);
32 | type = Number.JUST_PHONE;
33 |
34 | setContact(phoneNumber);
35 | type = Number.FULL;
36 | } catch (Exception e) {
37 | e.printStackTrace();
38 | }
39 | }
40 |
41 |
42 | private void setNumber(String phoneNumber) throws Exception {
43 | long numberInt = -1;
44 | try {
45 | numberInt = Long.parseLong(phoneNumber);
46 | } catch (Exception ignored) {}
47 |
48 | if (numberInt < 0) {
49 | throw new Exception("Hidden number");
50 | }
51 |
52 | number = PhoneNumberUtils.formatNumber(phoneNumber, "US");
53 | if (number == null) {
54 | number = phoneNumber;
55 | }
56 | }
57 |
58 | private void setContact(String phoneNumber) {
59 | ContentResolver contentResolver = context.getContentResolver();
60 |
61 |
62 | // Получаем URI номера
63 | Uri phoneUri = Uri.withAppendedPath(ContactsContract.PhoneLookup.CONTENT_FILTER_URI, Uri.encode(phoneNumber));
64 |
65 | // Получаем контакт по номеру
66 | Cursor contactCursor = contentResolver.query(phoneUri, null, null, null, null);
67 | assert contactCursor != null;
68 | contactCursor.moveToFirst();
69 |
70 | // Получаем ID контакта для запроса дополнительных данных
71 | String contactId = contactCursor.getString(contactCursor.getColumnIndex(ContactsContract.Contacts._ID));
72 |
73 | // Сохраняем имя
74 | name = contactCursor.getString(contactCursor.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));
75 |
76 | contactCursor.close();
77 |
78 |
79 | // Получаем организацию по ID контакта
80 | Cursor orgCursor = contentResolver.query(
81 | ContactsContract.Data.CONTENT_URI,
82 | null,
83 | ContactsContract.Data.CONTACT_ID + " = ? AND " + ContactsContract.Data.MIMETYPE + " = ?",
84 | new String[]{
85 | contactId,
86 | ContactsContract.CommonDataKinds.Organization.CONTENT_ITEM_TYPE
87 | },
88 | null
89 | );
90 | assert orgCursor != null;
91 | if (orgCursor.moveToFirst()) {
92 | // Получаем компанию и должность
93 | company = orgCursor.getString(orgCursor.getColumnIndex(ContactsContract.CommonDataKinds.Organization.COMPANY));
94 | companyPosition = orgCursor.getString(orgCursor.getColumnIndex(ContactsContract.CommonDataKinds.Organization.TITLE));
95 | }
96 |
97 | orgCursor.close();
98 |
99 |
100 | // Получаем URI контакта
101 | Uri contactUri = ContentUris.withAppendedId(ContactsContract.Contacts.CONTENT_URI, Long.parseLong(contactId));
102 |
103 | // Получаем URI фото
104 | Uri displayPhotoUri = Uri.withAppendedPath(contactUri, ContactsContract.Contacts.Photo.DISPLAY_PHOTO);
105 | try {
106 | AssetFileDescriptor photoFd = contentResolver.openAssetFileDescriptor(displayPhotoUri, "r");
107 | assert photoFd != null;
108 | photo = BitmapFactory.decodeStream(photoFd.createInputStream());
109 | } catch (Exception e) {
110 | photo = null;
111 | }
112 | }
113 | }
114 |
--------------------------------------------------------------------------------
/app/src/main/java/ru/raxee/call_screen/MainActivity.java:
--------------------------------------------------------------------------------
1 | package ru.raxee.call_screen;
2 |
3 | import android.Manifest;
4 | import android.content.Intent;
5 | import android.content.pm.PackageManager;
6 | import android.net.Uri;
7 | import android.provider.Settings;
8 | import android.support.annotation.NonNull;
9 | import android.support.v4.app.ActivityCompat;
10 | import android.support.v7.app.AppCompatActivity;
11 | import android.os.Bundle;
12 |
13 | public class MainActivity extends AppCompatActivity {
14 | final String[] PERMISSIONS = {
15 | Manifest.permission.ANSWER_PHONE_CALLS,
16 | Manifest.permission.CALL_PHONE,
17 | Manifest.permission.DISABLE_KEYGUARD,
18 | Manifest.permission.RECEIVE_BOOT_COMPLETED,
19 | Manifest.permission.READ_CONTACTS,
20 | Manifest.permission.READ_PHONE_STATE,
21 | Manifest.permission.SYSTEM_ALERT_WINDOW,
22 | };
23 | final int PERMISSIONS_REQUEST_CODE = 1;
24 | final int OVERLAY_PERMISSION_REQUEST_CODE = 2;
25 |
26 |
27 | @Override
28 | protected void onCreate(Bundle savedInstanceState) {
29 | super.onCreate(savedInstanceState);
30 | setContentView(R.layout.activity_main);
31 | requestPermissions();
32 | }
33 |
34 | private void requestPermissions() {
35 | for (String permission : PERMISSIONS) {
36 | if (permission.equals(Manifest.permission.SYSTEM_ALERT_WINDOW)) {
37 | continue;
38 | }
39 |
40 | if (ActivityCompat.checkSelfPermission(this, permission) == PackageManager.PERMISSION_DENIED) {
41 | ActivityCompat.requestPermissions(this, PERMISSIONS, PERMISSIONS_REQUEST_CODE);
42 | return;
43 | }
44 | }
45 |
46 | if (!Settings.canDrawOverlays(this)) {
47 | Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION, Uri.parse("package:" + getPackageName()));
48 | startActivityForResult(intent, OVERLAY_PERMISSION_REQUEST_CODE);
49 | }
50 | }
51 |
52 | @Override
53 | public void onRequestPermissionsResult(int requestCode, @NonNull String permissions[], @NonNull int[] grantResults) {
54 | switch (requestCode) {
55 | case PERMISSIONS_REQUEST_CODE:
56 | case OVERLAY_PERMISSION_REQUEST_CODE:
57 | requestPermissions();
58 | }
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/app/src/main/java/ru/raxee/call_screen/PhoneStateReceiver.java:
--------------------------------------------------------------------------------
1 | package ru.raxee.call_screen;
2 |
3 | import android.app.KeyguardManager;
4 | import android.content.BroadcastReceiver;
5 | import android.content.Context;
6 | import android.content.Intent;
7 | import android.os.PowerManager;
8 | import android.telephony.TelephonyManager;
9 |
10 | public class PhoneStateReceiver extends BroadcastReceiver {
11 | @Override
12 | public void onReceive(Context context, Intent intent) {
13 | if (TelephonyManager.ACTION_PHONE_STATE_CHANGED.equals(intent.getAction())) {
14 | RingingWindow ringingWindow = RingingWindow.getInstance();
15 |
16 | try {
17 | String state = intent.getStringExtra(TelephonyManager.EXTRA_STATE);
18 | if (TelephonyManager.EXTRA_STATE_RINGING.equals(state)) {
19 | processRinging(context, intent);
20 | }
21 | if (TelephonyManager.EXTRA_STATE_OFFHOOK.equals(state)) {
22 | ringingWindow.hide();
23 | }
24 | if (TelephonyManager.EXTRA_STATE_IDLE.equals(state)) {
25 | ringingWindow.hide();
26 | }
27 | } catch (Exception e) {
28 | ringingWindow.hide();
29 | e.printStackTrace();
30 | }
31 | }
32 | }
33 |
34 | private void processRinging(final Context context, Intent intent) {
35 | PowerManager powerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
36 | assert powerManager != null;
37 |
38 | KeyguardManager keyguardManager = (KeyguardManager) context.getSystemService(Context.KEYGUARD_SERVICE);
39 | assert keyguardManager != null;
40 |
41 | if (!powerManager.isInteractive() || keyguardManager.inKeyguardRestrictedInputMode()) {
42 | String phoneNumber = intent.getStringExtra(TelephonyManager.EXTRA_INCOMING_NUMBER);
43 | Contact contact = new Contact(phoneNumber);
44 |
45 | RingingWindow ringingWindow = RingingWindow.getInstance();
46 | ringingWindow.setData(contact);
47 | ringingWindow.show();
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/app/src/main/java/ru/raxee/call_screen/RingingWindow.java:
--------------------------------------------------------------------------------
1 | package ru.raxee.call_screen;
2 |
3 | import android.annotation.SuppressLint;
4 | import android.content.Context;
5 | import android.content.res.Resources;
6 | import android.graphics.PixelFormat;
7 | import android.support.design.widget.FloatingActionButton;
8 | import android.view.Gravity;
9 | import android.view.LayoutInflater;
10 | import android.view.View;
11 | import android.view.WindowManager;
12 | import android.widget.ImageView;
13 | import android.widget.TextView;
14 |
15 | class RingingWindow {
16 | @SuppressLint("StaticFieldLeak")
17 | private static RingingWindow instance = null;
18 |
19 | private Context context;
20 | private View ringingView;
21 | private boolean isShown = false;
22 |
23 |
24 | @SuppressLint("InflateParams")
25 | private RingingWindow() {
26 | context = App.getContext();
27 |
28 | LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
29 | assert inflater != null;
30 | ringingView = inflater.inflate(R.layout.activity_ringing, null);
31 |
32 |
33 | FloatingActionButton answerButton = ringingView.findViewById(R.id.answer);
34 | answerButton.setOnClickListener(new View.OnClickListener() {
35 | public void onClick(View buttonView) {
36 | answer();
37 | }
38 | });
39 |
40 | FloatingActionButton dismissButton = ringingView.findViewById(R.id.dismiss);
41 | dismissButton.setOnClickListener(new View.OnClickListener() {
42 | public void onClick(View buttonView) {
43 | dismiss();
44 | }
45 | });
46 | }
47 |
48 | static RingingWindow getInstance() {
49 | if (instance == null) {
50 | instance = new RingingWindow();
51 | }
52 |
53 | return instance;
54 | }
55 |
56 |
57 | void setData(Contact contact) {
58 | Resources resources = context.getResources();
59 |
60 | TextView name = ringingView.findViewById(R.id.name);
61 | TextView phone = ringingView.findViewById(R.id.phone);
62 | TextView company = ringingView.findViewById(R.id.company);
63 | ImageView photo = ringingView.findViewById(R.id.photo);
64 |
65 | name.setVisibility(View.GONE);
66 | phone.setVisibility(View.GONE);
67 | company.setVisibility(View.GONE);
68 | photo.setVisibility(View.GONE);
69 |
70 | switch (contact.type) {
71 | case HIDDEN:
72 | name.setText(R.string.hidden_number);
73 | name.setVisibility(View.VISIBLE);
74 | break;
75 |
76 | case JUST_PHONE:
77 | name.setText(contact.number);
78 | name.setVisibility(View.VISIBLE);
79 | break;
80 |
81 | case FULL: {
82 | name.setText(contact.name);
83 | name.setVisibility(View.VISIBLE);
84 |
85 | phone.setText(contact.number);
86 | phone.setVisibility(View.VISIBLE);
87 |
88 | if (contact.company != null) {
89 | if (contact.companyPosition != null) {
90 | company.setText(resources.getString(R.string.full_company, contact.company, contact.companyPosition));
91 | company.setVisibility(View.VISIBLE);
92 | } else {
93 | company.setText(contact.company);
94 | company.setVisibility(View.VISIBLE);
95 | }
96 | }
97 |
98 | if (contact.photo != null) {
99 | photo.setImageBitmap(contact.photo);
100 | photo.setVisibility(View.VISIBLE);
101 | }
102 |
103 | break;
104 | }
105 | }
106 | }
107 |
108 | void show() {
109 | if (!isShown) {
110 | WindowManager.LayoutParams params = new WindowManager.LayoutParams(
111 | WindowManager.LayoutParams.MATCH_PARENT,
112 | WindowManager.LayoutParams.MATCH_PARENT,
113 | WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY,
114 | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON | WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED,
115 | PixelFormat.TRANSLUCENT
116 | );
117 | params.gravity = Gravity.TOP | Gravity.START;
118 |
119 | WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
120 | assert windowManager != null;
121 | windowManager.addView(ringingView, params);
122 |
123 | isShown = true;
124 | }
125 | }
126 |
127 | void hide() {
128 | if (isShown) {
129 | WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
130 | assert windowManager != null;
131 | windowManager.removeView(ringingView);
132 |
133 | isShown = false;
134 | }
135 | }
136 |
137 |
138 | private void answer() {
139 | hide();
140 |
141 | Call call = Call.getInstance();
142 | call.answer();
143 | }
144 |
145 | private void dismiss() {
146 | hide();
147 |
148 | Call call = Call.getInstance();
149 | call.dismiss();
150 | }
151 | }
152 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_call_end_white_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_call_white_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
10 |
12 |
14 |
16 |
18 |
20 |
22 |
24 |
26 |
28 |
30 |
32 |
34 |
36 |
38 |
40 |
42 |
44 |
46 |
48 |
50 |
52 |
54 |
56 |
58 |
60 |
62 |
64 |
66 |
68 |
70 |
72 |
74 |
75 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
16 |
17 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_ringing.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
18 |
19 |
27 |
28 |
34 |
35 |
41 |
42 |
48 |
49 |
50 |
51 |
61 |
62 |
63 |
68 |
69 |
73 |
74 |
84 |
85 |
86 |
87 |
91 |
92 |
102 |
103 |
104 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vlad-iakovlev/RaxeeCallScreen/fcd514fdafcf84bdad487da91023a326539e1855/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vlad-iakovlev/RaxeeCallScreen/fcd514fdafcf84bdad487da91023a326539e1855/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vlad-iakovlev/RaxeeCallScreen/fcd514fdafcf84bdad487da91023a326539e1855/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vlad-iakovlev/RaxeeCallScreen/fcd514fdafcf84bdad487da91023a326539e1855/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vlad-iakovlev/RaxeeCallScreen/fcd514fdafcf84bdad487da91023a326539e1855/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vlad-iakovlev/RaxeeCallScreen/fcd514fdafcf84bdad487da91023a326539e1855/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vlad-iakovlev/RaxeeCallScreen/fcd514fdafcf84bdad487da91023a326539e1855/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vlad-iakovlev/RaxeeCallScreen/fcd514fdafcf84bdad487da91023a326539e1855/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vlad-iakovlev/RaxeeCallScreen/fcd514fdafcf84bdad487da91023a326539e1855/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vlad-iakovlev/RaxeeCallScreen/fcd514fdafcf84bdad487da91023a326539e1855/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 | #3F51B5
3 | #303F9F
4 | #FF4081
5 |
6 | #009688
7 | #E91E63
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Raxee Call Screen
3 |
4 | Номер скрыт
5 | %1$s - %2$s
6 | Фото
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
11 |
12 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | google()
7 | }
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:3.0.1'
10 |
11 | // NOTE: Do not place your application dependencies here; they belong
12 | // in the individual module build.gradle files
13 | }
14 | }
15 |
16 | allprojects {
17 | repositories {
18 | jcenter()
19 | google()
20 | }
21 | }
22 |
23 | task clean(type: Delete) {
24 | delete rootProject.buildDir
25 | }
26 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | org.gradle.jvmargs=-Xmx1536m
13 |
14 | # When configured, Gradle will run in incubating parallel mode.
15 | # This option should only be used with decoupled projects. More details, visit
16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17 | # org.gradle.parallel=true
18 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vlad-iakovlev/RaxeeCallScreen/fcd514fdafcf84bdad487da91023a326539e1855/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sat Nov 04 11:34:19 MSK 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------