Merge pull request '1' (#5) from test into 李贽
@ -1 +0,0 @@
|
||||
Hello world!
|
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 9.5 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 39 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 222 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 30 KiB |
@ -0,0 +1,14 @@
|
||||
*.iml
|
||||
.gradle
|
||||
/local.properties
|
||||
/.idea/caches
|
||||
/.idea/libraries
|
||||
/.idea/modules.xml
|
||||
/.idea/workspace.xml
|
||||
/.idea/navEditor.xml
|
||||
/.idea/assetWizardSettings.xml
|
||||
.DS_Store
|
||||
/build
|
||||
/captures
|
||||
.externalNativeBuild
|
||||
.cxx
|
@ -0,0 +1,3 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
@ -0,0 +1,116 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<code_scheme name="Project" version="173">
|
||||
<codeStyleSettings language="XML">
|
||||
<indentOptions>
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
||||
</indentOptions>
|
||||
<arrangement>
|
||||
<rules>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>xmlns:android</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>xmlns:.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:id</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:name</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>name</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>style</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>ANDROID_ATTRIBUTE_ORDER</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>.*</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
</rules>
|
||||
</arrangement>
|
||||
</codeStyleSettings>
|
||||
</code_scheme>
|
||||
</component>
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<bytecodeTargetLevel target="1.8" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="deploymentTargetDropDown">
|
||||
<targetSelectedWithDropDown>
|
||||
<Target>
|
||||
<type value="QUICK_BOOT_TARGET" />
|
||||
<deviceKey>
|
||||
<Key>
|
||||
<type value="VIRTUAL_DEVICE_PATH" />
|
||||
<value value="C:\Users\smith\.android\avd\Nexus_4_API_30.avd" />
|
||||
</Key>
|
||||
</deviceKey>
|
||||
</Target>
|
||||
</targetSelectedWithDropDown>
|
||||
<timeTargetWasSelectedWithDropDown value="2022-04-19T02:44:13.063728800Z" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="testRunner" value="GRADLE" />
|
||||
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/app" />
|
||||
</set>
|
||||
</option>
|
||||
<option name="resolveModulePerSourceSet" value="false" />
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RemoteRepositoriesConfiguration">
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Maven Central repository" />
|
||||
<option name="url" value="https://repo1.maven.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="jboss.community" />
|
||||
<option name="name" value="JBoss Community repository" />
|
||||
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="BintrayJCenter" />
|
||||
<option name="name" value="BintrayJCenter" />
|
||||
<option name="url" value="https://jcenter.bintray.com/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="Google" />
|
||||
<option name="name" value="Google" />
|
||||
<option name="url" value="https://dl.google.com/dl/android/maven2/" />
|
||||
</remote-repository>
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="DesignSurface">
|
||||
<option name="filePathToZoomLevelMap">
|
||||
<map>
|
||||
<entry key="..\:/Desktop/FallSafety-DetectorCaidas-master/FallSafety-DetectorCaidas-master/FallSafety/app/src/main/res/drawable/backbtn.xml" value="0.159375" />
|
||||
<entry key="..\:/Desktop/FallSafety-DetectorCaidas-master/FallSafety-DetectorCaidas-master/FallSafety/app/src/main/res/drawable/bg_color.xml" value="0.159375" />
|
||||
<entry key="..\:/Desktop/FallSafety-DetectorCaidas-master/FallSafety-DetectorCaidas-master/FallSafety/app/src/main/res/drawable/ic_contact.xml" value="0.159375" />
|
||||
<entry key="..\:/Desktop/FallSafety-DetectorCaidas-master/FallSafety-DetectorCaidas-master/FallSafety/app/src/main/res/drawable/ic_person_add_white_60dp.xml" value="0.159375" />
|
||||
<entry key="..\:/Desktop/FallSafety-DetectorCaidas-master/FallSafety-DetectorCaidas-master/FallSafety/app/src/main/res/drawable/ic_thumb_down_red_150dp.xml" value="0.159375" />
|
||||
<entry key="..\:/Desktop/FallSafety-DetectorCaidas-master/FallSafety-DetectorCaidas-master/FallSafety/app/src/main/res/drawable/ic_thumb_up_black_150dp.xml" value="0.159375" />
|
||||
<entry key="..\:/Desktop/FallSafety-DetectorCaidas-master/FallSafety-DetectorCaidas-master/FallSafety/app/src/main/res/drawable/ic_warning_black_24dp.xml" value="0.159375" />
|
||||
<entry key="..\:/Desktop/FallSafety-DetectorCaidas-master/FallSafety-DetectorCaidas-master/FallSafety/app/src/main/res/font/quicksand.xml" value="0.14351851851851852" />
|
||||
<entry key="..\:/Desktop/FallSafety-DetectorCaidas-master/FallSafety-DetectorCaidas-master/FallSafety/app/src/main/res/font/quicksand_medium.xml" value="0.14351851851851852" />
|
||||
<entry key="..\:/Desktop/FallSafety-DetectorCaidas-master/FallSafety-DetectorCaidas-master/FallSafety/app/src/main/res/layout/activity_contacts.xml" value="0.1" />
|
||||
<entry key="..\:/Desktop/FallSafety-DetectorCaidas-master/FallSafety-DetectorCaidas-master/FallSafety/app/src/main/res/layout/activity_edit.xml" value="0.14322916666666666" />
|
||||
<entry key="..\:/Desktop/FallSafety-DetectorCaidas-master/FallSafety-DetectorCaidas-master/FallSafety/app/src/main/res/layout/activity_main.xml" value="0.14322916666666666" />
|
||||
<entry key="..\:/Desktop/FallSafety-DetectorCaidas-master/FallSafety-DetectorCaidas-master/FallSafety/app/src/main/res/layout/activity_post_fall_detected.xml" value="0.14322916666666666" />
|
||||
<entry key="..\:/Desktop/FallSafety-DetectorCaidas-master/FallSafety-DetectorCaidas-master/FallSafety/app/src/main/res/layout/activity_splash_screen.xml" value="0.14322916666666666" />
|
||||
<entry key="..\:/Desktop/FallSafety-DetectorCaidas-master/FallSafety-DetectorCaidas-master/FallSafety/app/src/main/res/layout/app_widget.xml" value="0.14322916666666666" />
|
||||
<entry key="..\:/Desktop/FallSafety-DetectorCaidas-master/FallSafety-DetectorCaidas-master/FallSafety/app/src/main/res/layout/contacts_row.xml" value="0.14322916666666666" />
|
||||
<entry key="..\:/Desktop/FallSafety-DetectorCaidas-master/FallSafety-DetectorCaidas-master/FallSafety/app/src/main/res/layout/emergencia_activity.xml" value="0.14322916666666666" />
|
||||
<entry key="..\:/Desktop/FallSafety-DetectorCaidas-master/FallSafety-DetectorCaidas-master/FallSafety/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml" value="0.19895833333333332" />
|
||||
<entry key="..\:/Desktop/FallSafety-DetectorCaidas-master/FallSafety-DetectorCaidas-master/FallSafety/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml" value="0.19895833333333332" />
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
<option name="id" value="Android" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RenderSettings">
|
||||
<option name="showDecorations" value="true" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1 @@
|
||||
/build
|
@ -0,0 +1,31 @@
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
android {
|
||||
compileSdkVersion 29
|
||||
buildToolsVersion "29.0.3"
|
||||
defaultConfig {
|
||||
applicationId "com.example.fallsafety"
|
||||
minSdkVersion 23
|
||||
targetSdkVersion 29
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation 'androidx.appcompat:appcompat:1.2.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
testImplementation 'junit:junit:4.12'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
implementation 'com.google.android.material:material:1.2.0'
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.example.fallsafety;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
|
||||
assertEquals("com.example.fallsafety", appContext.getPackageName());
|
||||
}
|
||||
}
|
@ -0,0 +1,78 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="com.example.fallsafety">
|
||||
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.SEND_SMS" />
|
||||
<uses-permission android:name="android.permission.CALL_PHONE" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS"/>
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"
|
||||
tools:ignore="GoogleAppIndexingWarning">
|
||||
<receiver android:name=".AppWidget">
|
||||
<intent-filter>
|
||||
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
|
||||
</intent-filter>
|
||||
|
||||
<meta-data
|
||||
android:name="android.appwidget.provider"
|
||||
android:resource="@xml/new_app_widget_info" />
|
||||
</receiver>
|
||||
|
||||
|
||||
<activity
|
||||
android:name=".SplashScreen"
|
||||
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity android:name=".MainActivity" />
|
||||
<activity
|
||||
android:name=".ContactsActivity"
|
||||
android:label="@string/contactos"
|
||||
android:parentActivityName=".MainActivity" />
|
||||
<activity
|
||||
android:name=".EditActivity"
|
||||
android:label="@string/editContact"
|
||||
android:parentActivityName=".ContactsActivity" />
|
||||
<activity android:name=".PostFallDetected"
|
||||
android:label="@string/postFallDetected"
|
||||
android:parentActivityName=".MainActivity"/>
|
||||
<activity android:name=".Emergencia"
|
||||
android:label="@string/emergency"
|
||||
android:parentActivityName=".MainActivity"/>
|
||||
|
||||
<service
|
||||
android:name=".ActiveService"
|
||||
android:process=":service" />
|
||||
|
||||
<receiver
|
||||
android:name=".TelephonyReceiver"
|
||||
android:enabled="true"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.PHONE_STATE" />
|
||||
<action android:name="android.intent.action.NEW_OUTGOING_CALL" /> <!-- en principio este no hace falta -->
|
||||
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<meta-data
|
||||
android:name="preloaded_fonts"
|
||||
android:resource="@array/preloaded_fonts" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
After Width: | Height: | Size: 44 KiB |
@ -0,0 +1,50 @@
|
||||
package com.example.fallsafety;
|
||||
|
||||
import android.app.PendingIntent;
|
||||
import android.appwidget.AppWidgetManager;
|
||||
import android.appwidget.AppWidgetProvider;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.widget.RemoteViews;
|
||||
|
||||
|
||||
//Y
|
||||
|
||||
//应用程序小部件功能的实现。
|
||||
|
||||
public class AppWidget extends AppWidgetProvider {
|
||||
|
||||
static void updateAppWidget(Context context, AppWidgetManager appWidgetManager,
|
||||
int appWidgetId) {
|
||||
|
||||
Intent intent= new Intent(context, Emergencia.class);
|
||||
PendingIntent pendingIntent= PendingIntent.getActivity(context,0,intent,0);
|
||||
|
||||
|
||||
// 构造RemoteView对象
|
||||
RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.app_widget);
|
||||
views.setOnClickPendingIntent(R.id.btnadvicewidget, pendingIntent);
|
||||
|
||||
// 指示小部件管理器更新小部件
|
||||
appWidgetManager.updateAppWidget(appWidgetId, views);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
|
||||
// 可能有多个窗口小部件处于活动状态,因此请更新所有窗口小部件
|
||||
for (int appWidgetId : appWidgetIds) {
|
||||
updateAppWidget(context, appWidgetManager, appWidgetId);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnabled(Context context) {
|
||||
// 输入创建第一个小部件时的相关功能
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisabled(Context context) {
|
||||
// 输入最后一个小部件被禁用时的相关功能
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,214 @@
|
||||
package com.example.fallsafety;
|
||||
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.database.Cursor;
|
||||
import android.location.Criteria;
|
||||
import android.location.Location;
|
||||
import android.location.LocationListener;
|
||||
import android.location.LocationManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.telephony.SmsManager;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
|
||||
//X
|
||||
//紧急情况响应
|
||||
public class Emergencia extends AppCompatActivity{
|
||||
/*
|
||||
短信变量
|
||||
*/
|
||||
|
||||
SmsManager smsManager;
|
||||
String phoneNumber;
|
||||
String textMsg;
|
||||
|
||||
/*
|
||||
位置变量
|
||||
*/
|
||||
|
||||
double latitude, longitude;
|
||||
|
||||
|
||||
/*
|
||||
数据库变量
|
||||
*/
|
||||
private ContactsDbAdapter dbAdapter;
|
||||
|
||||
public Emergencia(){
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.emergencia_activity);
|
||||
|
||||
getLocation();
|
||||
|
||||
Toast.makeText(this, "clase emergencia", Toast.LENGTH_LONG).show();
|
||||
String smsEmergencia=getResources().getString(R.string.smsEmergencia);
|
||||
sendSMS(this, smsEmergencia);
|
||||
makeCall(this);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void sendSMS(Context context, String txt){
|
||||
|
||||
getLocation();
|
||||
|
||||
smsManager= SmsManager.getDefault();
|
||||
//textMsg=txt + "https://maps.google.com/?q="+String.valueOf(latitude)+","+String.valueOf(longitude) ;
|
||||
textMsg=txt + "https://maps.google.com/?q=40.332853,-3.765089" ;
|
||||
|
||||
Toast.makeText(context,"ENVIADO SMS", Toast.LENGTH_LONG).show();
|
||||
|
||||
/*
|
||||
遍历数据库
|
||||
*/
|
||||
|
||||
//我们创建了BD适配器并打开它
|
||||
dbAdapter = new ContactsDbAdapter(context);
|
||||
dbAdapter.open();
|
||||
|
||||
Cursor contactsCursor= dbAdapter.fetchAllContacts();
|
||||
if (contactsCursor.getCount()!=0){
|
||||
contactsCursor.moveToFirst();
|
||||
do{
|
||||
System.out.println("NOMBRE: " + contactsCursor.getString(1));
|
||||
System.out.println("TELEFONO: " + contactsCursor.getString(2));
|
||||
phoneNumber= contactsCursor.getString(2);
|
||||
System.out.println("PHONE NUMBER A MANDAR SMS: " + phoneNumber);
|
||||
System.out.println(textMsg);
|
||||
smsManager.sendTextMessage(phoneNumber, null, textMsg, null, null);
|
||||
|
||||
} while (contactsCursor.moveToNext());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void makeCall(Context context){
|
||||
|
||||
|
||||
//我们创建了BD适配器并打开它
|
||||
dbAdapter = new ContactsDbAdapter(context);
|
||||
dbAdapter.open();
|
||||
|
||||
Cursor contactsCursor= dbAdapter.fetchAllContacts();
|
||||
if (contactsCursor.getCount()!=0){
|
||||
contactsCursor.moveToFirst();
|
||||
|
||||
System.out.println("NOMBRE: " + contactsCursor.getString(1));
|
||||
System.out.println("TELEFONO: " + contactsCursor.getString(2));
|
||||
phoneNumber=contactsCursor.getString(2);
|
||||
|
||||
try{
|
||||
|
||||
System.out.println("OK");
|
||||
|
||||
if(ContextCompat.checkSelfPermission(context, Manifest.permission.CALL_PHONE)
|
||||
!= PackageManager.PERMISSION_GRANTED){
|
||||
|
||||
System.out.println("没有呼叫权限");
|
||||
|
||||
}
|
||||
|
||||
Intent intentLlamada = new Intent(Intent.ACTION_CALL, Uri.parse("tel:"+phoneNumber));
|
||||
intentLlamada.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
context.startActivity(intentLlamada);
|
||||
|
||||
} catch (Exception e){
|
||||
System.out.println("错误");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void getLocation(){
|
||||
try{
|
||||
|
||||
String serviceString= Context.LOCATION_SERVICE;
|
||||
LocationManager locationManager = (LocationManager) getSystemService(serviceString);
|
||||
|
||||
LocationListener locationListener= new LocationListener() {
|
||||
@Override
|
||||
public void onLocationChanged(Location location) {
|
||||
latitude= location.getLatitude();
|
||||
longitude= location.getLongitude();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStatusChanged(String provider, int status, Bundle extras) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onProviderEnabled(String provider) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onProviderDisabled(String provider) {
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
// 检查访问位置的权限
|
||||
if(ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION)
|
||||
!= PackageManager.PERMISSION_GRANTED){
|
||||
//ActivityCompat.requestPermissions(MainActivity.this.getApplicationContext(), new String[]{Manifest.permission.SEND_SMS}, REQUEST_PERMISSION_ACCESS_FINE_LOCATION);
|
||||
|
||||
Toast.makeText(this.getApplicationContext(), "没有位置权限", Toast.LENGTH_SHORT).show();
|
||||
|
||||
}
|
||||
|
||||
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 5000, 0, locationListener);
|
||||
|
||||
Criteria criteria= new Criteria();
|
||||
|
||||
|
||||
String provider= String.valueOf(locationManager.getBestProvider(criteria, true)).toString();
|
||||
|
||||
System.out.println("provider: " + provider);
|
||||
|
||||
Location location= locationManager.getLastKnownLocation(provider);
|
||||
if(location!=null){
|
||||
Log.e("TAG", "GPS ON");
|
||||
latitude=location.getLatitude();
|
||||
longitude=location.getLongitude();
|
||||
} else{
|
||||
locationManager.requestLocationUpdates(provider, 1000,0, locationListener );
|
||||
}
|
||||
|
||||
locationManager.requestLocationUpdates(provider, 5000, 0, locationListener);
|
||||
|
||||
System.out.println("lat" + latitude + "lon " + longitude);
|
||||
|
||||
} catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,79 @@
|
||||
package com.example.fallsafety;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.CountDownTimer;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.Toast;
|
||||
|
||||
//Y
|
||||
//故障后检测
|
||||
public class PostFallDetected extends AppCompatActivity implements View.OnClickListener {
|
||||
|
||||
private Context mCtx =this;
|
||||
private ImageButton btnNoCaida;
|
||||
private ImageButton btnSiCaida;
|
||||
private CountDownTimer count;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_post_fall_detected);
|
||||
|
||||
|
||||
btnNoCaida = (ImageButton) findViewById(R.id.btnNoCaida);
|
||||
btnNoCaida.setOnClickListener(this);
|
||||
btnSiCaida= (ImageButton) findViewById(R.id.btnSiCaida);
|
||||
btnSiCaida.setOnClickListener(this);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()){
|
||||
case R.id.btnNoCaida:
|
||||
|
||||
cancelarServicio();
|
||||
|
||||
Toast toast = Toast.makeText(this, "AVISO CANCELADO", Toast.LENGTH_LONG);
|
||||
toast.setGravity(Gravity.CENTER,0,0);
|
||||
toast.show();
|
||||
|
||||
break;
|
||||
|
||||
case R.id.btnSiCaida:
|
||||
|
||||
cancelarServicio();
|
||||
Intent intent= new Intent(this, Emergencia.class);
|
||||
startActivity(intent);
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void cancelarServicio(){
|
||||
stopService(new Intent(mCtx, ActiveService.class));
|
||||
|
||||
count = new CountDownTimer( 30000,1000) {
|
||||
@Override
|
||||
public void onTick(long millisUntilFinished) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
startService(new Intent(mCtx, ActiveService.class));
|
||||
}
|
||||
}.start();
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package com.example.fallsafety;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
//X
|
||||
//初始化界面的设计
|
||||
|
||||
public class SplashScreen extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_splash_screen);
|
||||
|
||||
int time=2000;
|
||||
|
||||
|
||||
|
||||
// 输入一个延迟时间,使活动持续运行运行几秒钟。
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
//在一段时间后运行下面的内容
|
||||
public void run() {
|
||||
Intent intent = new Intent (SplashScreen.this, MainActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
},time); //暂定4秒
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.example.fallsafety;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.media.AudioManager;
|
||||
import android.telephony.TelephonyManager;
|
||||
import android.widget.Toast;
|
||||
|
||||
//Y
|
||||
//收电话
|
||||
|
||||
public class TelephonyReceiver extends BroadcastReceiver {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
TelephonyManager telephonyManager= (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
|
||||
switch (telephonyManager.getCallState()){
|
||||
case TelephonyManager.CALL_STATE_RINGING:
|
||||
|
||||
break;
|
||||
case TelephonyManager.CALL_STATE_IDLE:
|
||||
|
||||
AudioManager man= (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
|
||||
man.setSpeakerphoneOn(false);
|
||||
break;
|
||||
case TelephonyManager.CALL_STATE_OFFHOOK:
|
||||
|
||||
|
||||
|
||||
AudioManager manager= (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
|
||||
manager.setMode(AudioManager.MODE_IN_COMMUNICATION);
|
||||
manager.setStreamVolume(AudioManager.STREAM_VOICE_CALL,manager.getStreamMaxVolume(AudioManager.STREAM_VOICE_CALL),0);
|
||||
manager.setSpeakerphoneOn(true);
|
||||
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:color="@color/colorVerde"
|
||||
android:state_checked="true" />
|
||||
<item android:color="@color/colorRojo"/>
|
||||
|
||||
</selector>
|
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/colorPastel"/>
|
||||
<corners android:radius="200dp"/>
|
||||
|
||||
|
||||
</shape>
|
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<gradient
|
||||
android:angle="225"
|
||||
android:endColor="@color/colorBlanco"
|
||||
android:startColor="@color/colorBlanco"/>
|
||||
|
||||
</shape>
|
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M12,12c2.21,0 4,-1.79 4,-4s-1.79,-4 -4,-4 -4,1.79 -4,4 1.79,4 4,4zM12,14c-2.67,0 -8,1.34 -8,4v2h16v-2c0,-2.66 -5.33,-4 -8,-4z"/>
|
||||
</vector>
|
@ -0,0 +1,5 @@
|
||||
<vector android:height="60dp" android:tint="#FFFFFF"
|
||||
android:viewportHeight="24.0" android:viewportWidth="24.0"
|
||||
android:width="60dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#F0000000" android:pathData="M15,12c2.21,0 4,-1.79 4,-4s-1.79,-4 -4,-4 -4,1.79 -4,4 1.79,4 4,4zM6,10L6,7L4,7v3L1,10v2h3v3h2v-3h3v-2L6,10zM15,14c-2.67,0 -8,1.34 -8,4v2h16v-2c0,-2.66 -5.33,-4 -8,-4z"/>
|
||||
</vector>
|
@ -0,0 +1,5 @@
|
||||
<vector android:height="250dp" android:tint="#F20D0C"
|
||||
android:viewportHeight="24.0" android:viewportWidth="24.0"
|
||||
android:width="250dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FF000000" android:pathData="M15,3L6,3c-0.83,0 -1.54,0.5 -1.84,1.22l-3.02,7.05c-0.09,0.23 -0.14,0.47 -0.14,0.73v1.91l0.01,0.01L1,14c0,1.1 0.9,2 2,2h6.31l-0.95,4.57 -0.03,0.32c0,0.41 0.17,0.79 0.44,1.06L9.83,23l6.59,-6.59c0.36,-0.36 0.58,-0.86 0.58,-1.41L17,5c0,-1.1 -0.9,-2 -2,-2zM19,3v12h4L23,3h-4z"/>
|
||||
</vector>
|
@ -0,0 +1,5 @@
|
||||
<vector android:height="250dp" android:tint="#11F222"
|
||||
android:viewportHeight="24.0" android:viewportWidth="24.0"
|
||||
android:width="250dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FF000000" android:pathData="M1,21h4L5,9L1,9v12zM23,10c0,-1.1 -0.9,-2 -2,-2h-6.31l0.95,-4.57 0.03,-0.32c0,-0.41 -0.17,-0.79 -0.44,-1.06L14.17,1 7.59,7.59C7.22,7.95 7,8.45 7,9v10c0,1.1 0.9,2 2,2h9c0.83,0 1.54,-0.5 1.84,-1.22l3.02,-7.05c0.09,-0.23 0.14,-0.47 0.14,-0.73v-1.91l-0.01,-0.01L23,10z"/>
|
||||
</vector>
|
@ -0,0 +1,5 @@
|
||||
<vector android:height="250dp" android:tint="#F20D0C"
|
||||
android:viewportHeight="24.0" android:viewportWidth="24.0"
|
||||
android:width="250dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FF000000" android:pathData="M1,21h22L12,2 1,21zM13,18h-2v-2h2v2zM13,14h-2v-4h2v4z"/>
|
||||
</vector>
|
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 111 KiB |
After Width: | Height: | Size: 5.1 KiB |
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<font-family xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
app:fontProviderAuthority="com.google.android.gms.fonts"
|
||||
app:fontProviderPackage="com.google.android.gms"
|
||||
app:fontProviderQuery="Quicksand"
|
||||
app:fontProviderCerts="@array/com_google_android_gms_fonts_certs">
|
||||
</font-family>
|
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<font-family xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
app:fontProviderAuthority="com.google.android.gms.fonts"
|
||||
app:fontProviderPackage="com.google.android.gms"
|
||||
app:fontProviderQuery="name=Quicksand&weight=500"
|
||||
app:fontProviderCerts="@array/com_google_android_gms_fonts_certs">
|
||||
</font-family>
|
@ -0,0 +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:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_color">
|
||||
|
||||
<Button
|
||||
android:id="@+id/addContact"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp"
|
||||
android:background="@color/colorGris"
|
||||
android:fontFamily="@font/quicksand_medium"
|
||||
android:onClick="createContact"
|
||||
android:text="@string/addContact"
|
||||
android:textSize="30sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ListView
|
||||
android:id="@+id/id_list_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
@ -0,0 +1,102 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.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=".EditActivity">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_color"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingRight="16dp"
|
||||
android:paddingBottom="16dp">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/nombreContacto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:fontFamily="@font/quicksand_medium"
|
||||
android:hint="@string/editNombre"
|
||||
android:inputType="text"
|
||||
android:textSize="24sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/numeroContacto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp"
|
||||
android:layout_below="@+id/nombreContacto"
|
||||
android:layout_marginTop="30dp"
|
||||
android:fontFamily="@font/quicksand_medium"
|
||||
android:hint="@string/editNumero"
|
||||
android:inputType="phone"
|
||||
android:textSize="24sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/prioridadContacto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp"
|
||||
android:layout_below="@+id/numeroContacto"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_marginBottom="40dp"
|
||||
android:fontFamily="@font/quicksand_medium"
|
||||
android:hint="@string/editPrioridad"
|
||||
android:inputType="number"
|
||||
android:textSize="24sp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/guardar"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/prioridadContacto"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@drawable/backbtn"
|
||||
android:fontFamily="@font/quicksand_medium"
|
||||
android:onClick="saveNote"
|
||||
android:text="@string/guardar"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/borrar"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignEnd="@+id/prioridadContacto"
|
||||
android:layout_alignBottom="@+id/guardar"
|
||||
android:layout_marginTop="10dp"
|
||||
android:onClick="deleteContact"
|
||||
android:background="@drawable/backbtn"
|
||||
android:text="@string/borrar"
|
||||
android:fontFamily="@font/quicksand_medium"
|
||||
android:textStyle="bold"
|
||||
android:textSize="24sp"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fab"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end|bottom"
|
||||
android:layout_margin="16dp"
|
||||
app:srcCompat="@drawable/ic_person_add_white_60dp"
|
||||
app:fabCustomSize="80dp"
|
||||
app:maxImageSize="50dp"
|
||||
android:scaleType="center"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -0,0 +1,90 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.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=".MainActivity">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/bg_color">
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="50dp"
|
||||
android:paddingEnd="100dp"
|
||||
android:paddingStart="100dp">
|
||||
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/btnadvice"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@null"
|
||||
android:src="@drawable/backbtn" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textEstado"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:fontFamily="@font/quicksand_medium"
|
||||
android:text="@string/estadoOff"
|
||||
android:textColor="@color/colorBlack"
|
||||
android:gravity="center"
|
||||
android:textSize="30sp" />
|
||||
|
||||
|
||||
<Switch
|
||||
android:id="@+id/btnswitch"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:scaleX="3"
|
||||
android:scaleY="3"
|
||||
style="@style/SwitchCompatTheme"
|
||||
android:onClick="clickSwitch"/>
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnContactos"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:alpha="0.9"
|
||||
android:background="@drawable/backbtn"
|
||||
android:fontFamily="@font/quicksand_medium"
|
||||
android:textStyle="bold"
|
||||
android:textSize="35sp"
|
||||
android:onClick="Contact"
|
||||
android:text="@string/contactos" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</ScrollView>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/bg_color"
|
||||
tools:context=".PostFallDetected">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/btnNoCaida"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@null"
|
||||
android:src="@drawable/ic_thumb_up_black_150dp" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/btnSiCaida"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@null"
|
||||
android:src="@drawable/ic_thumb_down_red_150dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:background="@color/colorPastel">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/image"/>
|
||||
|
||||
|
||||
</LinearLayout>
|
@ -0,0 +1,16 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@null"
|
||||
android:padding="@dimen/widget_margin">
|
||||
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/btnadvicewidget"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@null"
|
||||
android:src="@drawable/ic_warning_black_24dp" />
|
||||
|
||||
|
||||
</LinearLayout>
|
@ -0,0 +1,51 @@
|
||||
|
||||
<LinearLayout
|
||||
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:background="@color/colorBack">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageContact"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="100dp"
|
||||
android:layout_weight="30"
|
||||
android:padding="10dp"
|
||||
android:src="@drawable/ic_contact"
|
||||
android:background="@color/colorRosa"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="100dp"
|
||||
android:layout_weight="80"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingEnd="10dp"
|
||||
android:fontFamily="@font/quicksand_medium"
|
||||
android:gravity="center|start"
|
||||
android:textStyle="bold"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingEnd="10dp"
|
||||
android:fontFamily="@font/quicksand_medium"
|
||||
android:gravity="center|start"
|
||||
android:textStyle="bold"
|
||||
android:textSize="18sp"/>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
@ -0,0 +1,56 @@
|
||||
<?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:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".Emergencia">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="40dp"
|
||||
android:paddingEnd="40dp"
|
||||
android:paddingStart="40dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingTop="10dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:fontFamily="@font/quicksand_medium"
|
||||
android:text="@string/emergencia1"
|
||||
android:textColor="@color/colorBlack"
|
||||
android:gravity="center"
|
||||
android:textSize="30sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingTop="20dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:fontFamily="@font/quicksand_medium"
|
||||
android:text="@string/emergencia2"
|
||||
android:textColor="@color/colorBlack"
|
||||
android:gravity="center"
|
||||
android:textSize="30sp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/icon"
|
||||
android:paddingTop="50dp"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@color/ic_launcher_background"/>
|
||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||
</adaptive-icon>
|
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@color/ic_launcher_background"/>
|
||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||
</adaptive-icon>
|
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.7 KiB |