parent
4c2c51e20f
commit
fdcdfe0302
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="VcsDirectoryMappings">
|
<component name="VcsDirectoryMappings">
|
||||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
<mapping directory="$PROJECT_DIR$" vcs="" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
@ -0,0 +1,21 @@
|
|||||||
|
<resources>
|
||||||
|
<!--
|
||||||
|
TODO: Before you run your application, you need a Google Maps API key.
|
||||||
|
|
||||||
|
To get one, follow this link, follow the directions and press "Create" at the end:
|
||||||
|
|
||||||
|
https://console.developers.google.com/flows/enableapi?apiid=maps_android_backend&keyType=CLIENT_SIDE_ANDROID&r=E9:60:CD:76:86:55:1F:5A:40:5B:0F:EE:89:E9:FC:1E:60:6B:C9:AB%3Bhtdinc.howtodrink
|
||||||
|
|
||||||
|
You can also add your credentials to an existing key, using this line:
|
||||||
|
E9:60:CD:76:86:55:1F:5A:40:5B:0F:EE:89:E9:FC:1E:60:6B:C9:AB;htdinc.howtodrink
|
||||||
|
|
||||||
|
Alternatively, follow the directions here:
|
||||||
|
https://developers.google.com/maps/documentation/android/start#get-key
|
||||||
|
|
||||||
|
Once you have your key (it starts with "AIza"), replace the "google_maps_key"
|
||||||
|
string in this file.
|
||||||
|
-->
|
||||||
|
<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">
|
||||||
|
AIzaSyDPBQN-KCbyQp02BzPdWfFXKGo0C97sYzk
|
||||||
|
</string>
|
||||||
|
</resources>
|
@ -1,30 +0,0 @@
|
|||||||
package htdinc.howtodrink;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.support.v7.app.AppCompatActivity;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.view.View;
|
|
||||||
import android.widget.Button;
|
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
public class MainActivity extends AppCompatActivity {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
setContentView(R.layout.activity_main);
|
|
||||||
|
|
||||||
final Button bouton = (Button) findViewById(R.id.button);
|
|
||||||
bouton.setOnClickListener(new View.OnClickListener(){
|
|
||||||
public void onClick(View v)
|
|
||||||
{
|
|
||||||
Context context = getApplicationContext();
|
|
||||||
CharSequence text = "Ceci est un boutton bite !";
|
|
||||||
int duration = Toast.LENGTH_SHORT;
|
|
||||||
|
|
||||||
Toast.makeText(context,text,duration).show();
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,35 @@
|
|||||||
|
package htdinc.howtodrink.display;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.support.v7.app.ActionBar;
|
||||||
|
import android.support.v7.app.AppCompatActivity;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.view.MotionEvent;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
import htdinc.howtodrink.R;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An example full-screen activity that shows and hides the system UI (i.e.
|
||||||
|
* status bar and navigation/system bar) with user interaction.
|
||||||
|
*/
|
||||||
|
public class Container extends AppCompatActivity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Touch listener to use for in-layout UI controls to delay hiding the
|
||||||
|
* system UI. This is to prevent the jarring behavior of controls going away
|
||||||
|
* while interacting with activity UI.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
setContentView(R.layout.activity_container);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,48 @@
|
|||||||
|
package htdinc.howtodrink.display;
|
||||||
|
|
||||||
|
import android.support.v4.app.FragmentActivity;
|
||||||
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
import com.google.android.gms.maps.CameraUpdateFactory;
|
||||||
|
import com.google.android.gms.maps.GoogleMap;
|
||||||
|
import com.google.android.gms.maps.OnMapReadyCallback;
|
||||||
|
import com.google.android.gms.maps.SupportMapFragment;
|
||||||
|
import com.google.android.gms.maps.model.LatLng;
|
||||||
|
import com.google.android.gms.maps.model.MarkerOptions;
|
||||||
|
|
||||||
|
import htdinc.howtodrink.R;
|
||||||
|
|
||||||
|
public class MapsActivity extends FragmentActivity implements OnMapReadyCallback {
|
||||||
|
|
||||||
|
private GoogleMap mMap;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_maps);
|
||||||
|
// Obtain the SupportMapFragment and get notified when the map is ready to be used.
|
||||||
|
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
|
||||||
|
.findFragmentById(R.id.map);
|
||||||
|
mapFragment.getMapAsync(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Manipulates the map once available.
|
||||||
|
* This callback is triggered when the map is ready to be used.
|
||||||
|
* This is where we can add markers or lines, add listeners or move the camera. In this case,
|
||||||
|
* we just add a marker near Sydney, Australia.
|
||||||
|
* If Google Play services is not installed on the device, the user will be prompted to install
|
||||||
|
* it inside the SupportMapFragment. This method will only be triggered once the user has
|
||||||
|
* installed Google Play services and returned to the app.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void onMapReady(GoogleMap googleMap) {
|
||||||
|
mMap = googleMap;
|
||||||
|
|
||||||
|
// Add a marker in Sydney and move the camera
|
||||||
|
LatLng sydney = new LatLng(-34, 151);
|
||||||
|
mMap.addMarker(new MarkerOptions().position(sydney).title("Marker in Sydney"));
|
||||||
|
mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,35 @@
|
|||||||
|
<FrameLayout 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="#868686"
|
||||||
|
tools:context=".display.Container"
|
||||||
|
android:transitionGroup="false">
|
||||||
|
|
||||||
|
<!-- The primary full-screen view. This can be replaced with whatever view
|
||||||
|
is needed to present your content, e.g. VideoView, SurfaceView,
|
||||||
|
TextureView, etc. -->
|
||||||
|
|
||||||
|
<!-- This FrameLayout insets its children based on system windows using
|
||||||
|
android:fitsSystemWindows. -->
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/fullscreen_content"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:fitsSystemWindows="true">
|
||||||
|
|
||||||
|
<include
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="362dp"
|
||||||
|
layout="@layout/activity_maps"
|
||||||
|
android:layout_gravity="left|right"
|
||||||
|
android:layout_marginTop="0dp" />
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="150dp"
|
||||||
|
android:layout_gravity="bottom|center_horizontal"></FrameLayout>
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
</FrameLayout>
|
@ -1,19 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<RelativeLayout 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:paddingBottom="@dimen/activity_vertical_margin"
|
|
||||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
|
||||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
|
||||||
android:paddingTop="@dimen/activity_vertical_margin"
|
|
||||||
tools:context="htdinc.howtodrink.MainActivity">
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="Bite"
|
|
||||||
android:id="@+id/button"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:layout_centerHorizontal="true" />
|
|
||||||
</RelativeLayout>
|
|
@ -0,0 +1,8 @@
|
|||||||
|
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:map="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:id="@+id/map"
|
||||||
|
android:name="com.google.android.gms.maps.SupportMapFragment"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
tools:context=".display.MapsActivity" />
|
@ -0,0 +1,12 @@
|
|||||||
|
<resources>
|
||||||
|
|
||||||
|
<!-- Declare custom theme attributes that allow changing which styles are
|
||||||
|
used for button bars depending on the API level.
|
||||||
|
?android:attr/buttonBarStyle is new as of API 11 so this is
|
||||||
|
necessary to support previous API levels. -->
|
||||||
|
<declare-styleable name="ButtonBarContainerTheme">
|
||||||
|
<attr name="metaButtonBarStyle" format="reference" />
|
||||||
|
<attr name="metaButtonBarButtonStyle" format="reference" />
|
||||||
|
</declare-styleable>
|
||||||
|
|
||||||
|
</resources>
|
@ -0,0 +1,22 @@
|
|||||||
|
<resources>
|
||||||
|
<!--
|
||||||
|
TODO: Before you release your application, you need a Google Maps API key.
|
||||||
|
|
||||||
|
To do this, you can either add your release key credentials to your existing
|
||||||
|
key, or create a new key.
|
||||||
|
|
||||||
|
Note that this file specifies the API key for the release build target.
|
||||||
|
If you have previously set up a key for the debug target with the debug signing certificate,
|
||||||
|
you will also need to set up a key for your release certificate.
|
||||||
|
|
||||||
|
Follow the directions here:
|
||||||
|
|
||||||
|
https://developers.google.com/maps/documentation/android/signup
|
||||||
|
|
||||||
|
Once you have your key (it starts with "AIza"), replace the "google_maps_key"
|
||||||
|
string in this file.
|
||||||
|
-->
|
||||||
|
<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">
|
||||||
|
YOUR_KEY_HERE
|
||||||
|
</string>
|
||||||
|
</resources>
|
Loading…
Reference in new issue