Commit 355a5296 authored by Corentin Mors's avatar Corentin Mors
Browse files

Enhance app design

parent c75ed000
......@@ -23,7 +23,7 @@
<PersistentState>
<option name="values">
<map>
<entry key="url" value="jar:file:/opt/android-studio/plugins/android/lib/android.jar!/images/material_design_icons/maps/ic_person_pin_circle_black_24dp.xml" />
<entry key="url" value="jar:file:/opt/android-studio/plugins/android/lib/android.jar!/images/material_design_icons/action/ic_settings_black_24dp.xml" />
</map>
</option>
</PersistentState>
......@@ -33,7 +33,8 @@
</option>
<option name="values">
<map>
<entry key="outputName" value="ic_person_pin_circle_black_24dp" />
<entry key="color" value="ffffff" />
<entry key="outputName" value="ic_settings_black_24dp" />
<entry key="sourceFile" value="$USER_HOME$" />
</map>
</option>
......
......@@ -17,10 +17,17 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-v4:28.0.0'
......
......@@ -18,6 +18,10 @@ import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.TextView;
import com.sothree.slidinguppanel.SlidingUpPanelLayout;
import org.json.JSONException;
import org.json.JSONObject;
......@@ -31,6 +35,12 @@ import org.osmdroid.views.overlay.Marker;
import java.util.HashMap;
import java.util.Map;
import com.sothree.slidinguppanel.SlidingUpPanelLayout;
import com.sothree.slidinguppanel.SlidingUpPanelLayout.PanelSlideListener;
import com.sothree.slidinguppanel.SlidingUpPanelLayout.PanelState;
import io.socket.client.Socket;
import io.socket.emitter.Emitter;
......@@ -46,6 +56,8 @@ public class MainActivity extends AppCompatActivity {
private LocationManager mLocManager;
private LocationListener mLocListener;
private SlidingUpPanelLayout mLayout;
MapView map = null;
GeoPoint currentLocation;
......@@ -118,7 +130,7 @@ public class MainActivity extends AppCompatActivity {
mSocket.on("user left", onUserLeft);
// Handle setting button to access parameters view
Button settingsButton = findViewById(R.id.accessSettings);
ImageButton settingsButton = findViewById(R.id.accessSettings);
settingsButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
......@@ -128,6 +140,26 @@ public class MainActivity extends AppCompatActivity {
finish();
}
});
// Prepare to handel notch devices
/*
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowTranslucentNavigation">true</item>
*/
mLayout = findViewById(R.id.sliding_layout);
mLayout.addPanelSlideListener(new PanelSlideListener() {
@Override
public void onPanelSlide(View panel, float slideOffset) {
// Log.i("OM_slide", "onPanelSlide, offset " + slideOffset);
}
@Override
public void onPanelStateChanged(View panel, PanelState previousState, PanelState newState) {
// Log.i("OM_slide", "onPanelStateChanged " + newState);
}
});
}
@Override
......
......@@ -9,6 +9,7 @@ import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
......@@ -22,6 +23,10 @@ public class SettingsActivity extends AppCompatActivity {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_settings);
Toolbar myToolbar = (Toolbar) findViewById(R.id.my_toolbar);
setSupportActionBar(myToolbar);
if (ContextCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_FINE_LOCATION)
!= PackageManager.PERMISSION_GRANTED || ContextCompat.checkSelfPermission(this,
......
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M19.43,12.98c0.04,-0.32 0.07,-0.64 0.07,-0.98s-0.03,-0.66 -0.07,-0.98l2.11,-1.65c0.19,-0.15 0.24,-0.42 0.12,-0.64l-2,-3.46c-0.12,-0.22 -0.39,-0.3 -0.61,-0.22l-2.49,1c-0.52,-0.4 -1.08,-0.73 -1.69,-0.98l-0.38,-2.65C14.46,2.18 14.25,2 14,2h-4c-0.25,0 -0.46,0.18 -0.49,0.42l-0.38,2.65c-0.61,0.25 -1.17,0.59 -1.69,0.98l-2.49,-1c-0.23,-0.09 -0.49,0 -0.61,0.22l-2,3.46c-0.13,0.22 -0.07,0.49 0.12,0.64l2.11,1.65c-0.04,0.32 -0.07,0.65 -0.07,0.98s0.03,0.66 0.07,0.98l-2.11,1.65c-0.19,0.15 -0.24,0.42 -0.12,0.64l2,3.46c0.12,0.22 0.39,0.3 0.61,0.22l2.49,-1c0.52,0.4 1.08,0.73 1.69,0.98l0.38,2.65c0.03,0.24 0.24,0.42 0.49,0.42h4c0.25,0 0.46,-0.18 0.49,-0.42l0.38,-2.65c0.61,-0.25 1.17,-0.59 1.69,-0.98l2.49,1c0.23,0.09 0.49,0 0.61,-0.22l2,-3.46c0.12,-0.22 0.07,-0.49 -0.12,-0.64l-2.11,-1.65zM12,15.5c-1.93,0 -3.5,-1.57 -3.5,-3.5s1.57,-3.5 3.5,-3.5 3.5,1.57 3.5,3.5 -1.57,3.5 -3.5,3.5z"/>
</vector>
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar
android:id="@+id/my_toolbar"
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="@color/colorPrimary"
android:elevation="4dp"
android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
android:popupTheme="@style/ThemeOverlay.AppCompat.Light"
xmlns:android="http://schemas.android.com/apk/res/android" />
\ No newline at end of file
......@@ -4,12 +4,15 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
android:fitsSystemWindows="true"
tools:ignore="MergeRootFrame">
<com.sothree.slidinguppanel.SlidingUpPanelLayout
xmlns:sothree="http://schemas.android.com/apk/res-auto"
android:id="@+id/sliding_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
sothree:umanoPanelHeight="60dp"
sothree:umanoParallaxOffset="100dp"
android:gravity="bottom">
<org.osmdroid.views.MapView
......@@ -28,12 +31,12 @@
android:background="#ffffff"
android:orientation="vertical"
android:clickable="true"
android:focusable="false"
android:focusable="true"
android:id="@+id/dragView">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="68dp"
android:layout_height="60dp"
android:orientation="horizontal">
<TextView
......@@ -43,17 +46,22 @@
android:layout_weight="1"
android:gravity="center_vertical"
android:paddingLeft="10dp"
android:text="Open Chat"
android:textSize="14sp" />
<Button
<ImageButton
android:id="@+id/accessSettings"
android:src="@drawable/ic_settings_white_24dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:gravity="center_vertical"
android:text="Settings" />
android:bottomRightRadius="20dp"
android:bottomLeftRadius="20dp"
android:topRightRadius="20dp"
android:topLeftRadius="20dp"
android:backgroundTint="@color/colorPrimary"
/>
</LinearLayout>
......
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:windowActionBarOverlay">true</item>
<item name="android:windowActionBarOverlay">false</item>
</style>
</resources>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment