Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
laurens-dg committed Jul 23, 2014
2 parents 07917f8 + ad91795 commit 51171d7
Show file tree
Hide file tree
Showing 50 changed files with 271 additions and 15 deletions.
Binary file modified app/build/outputs/apk/app-release-unaligned.apk
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
import android.graphics.drawable.GradientDrawable;
import android.net.Uri;
import android.support.v4.view.GestureDetectorCompat;
import android.support.v7.app.ActionBarActivity;
Expand Down Expand Up @@ -139,12 +141,23 @@ private void initGui(boolean fromPanorama) {
tvs.setText(name);
desc.setMovementMethod(new ScrollingMovementMethod());
desc.setText(wp.getDescription());
imgType.setImageDrawable(POI.getTypePopupImg(wp.type,this));

/*Set the correct type image according to the orientation of the device*/
if(getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT ){
imgType.setImageDrawable(POI.getTypePopupImg(wp.type, this));
}else{
imgType.setImageDrawable(POI.getTypePopupImgLandscape(wp.type,this));
if(!DataManager.shownMonumentDetailLandscapeMsg) {
Toast.makeText(this, getResources().getString(R.string.monument_landscape_msg), Toast.LENGTH_SHORT).show();
DataManager.shownMonumentDetailLandscapeMsg = true;
}
}


/*if the device is a phone, the screen can't be tilted see #66 on GitHub*/
if(!ScreenUtils.isTablet(this)) {
/*if(!ScreenUtils.isTablet(this)) {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_NOSENSOR);
}
}*/

Picasso.with(this).load(wp.image_link).into(img, new Callback() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,16 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_new_route);
initGUI();
//setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_NOSENSOR);

if (savedInstanceState == null) {
mapFragment = new MapFragment();
mapFragment.isFullscreen = false;
getSupportFragmentManager().beginTransaction()
.add(R.id.container, mapFragment)
.commit();
}else{
MapFragment mfrag = (MapFragment) getSupportFragmentManager().findFragmentById(R.id.container);
mfrag.isFullscreen = false;
}
}

Expand Down
3 changes: 3 additions & 0 deletions app/src/main/java/be/artoria/belfortapp/app/DataManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,7 @@ public static void clearpois() {
}

public static int lastViewedPOI = 1;

/*Only show the swipe... msg once*/
public static boolean shownMonumentDetailLandscapeMsg = false;
}
40 changes: 29 additions & 11 deletions app/src/main/java/be/artoria/belfortapp/app/POI.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,24 +97,42 @@ public String toString(){


public static Drawable getTypeImg(int type,Context context){
return getTypeImage(type,context,false);
return getTypeImage(type,context,DRAG_HANDLE);
}

public static Drawable getTypePopupImg(int type, Context context){
return getTypeImage(type,context,true);
return getTypeImage(type,context,POPUP_PORTRAIT);
}

private static Drawable getTypeImage(int type, Context context, boolean popup){
public static Drawable getTypePopupImgLandscape(int type, Context context){
return getTypeImage(type,context,POPUP_LANDSCAPE);
}

private static final int DRAG_HANDLE = 0;
private static final int POPUP_PORTRAIT = 1;
private static final int POPUP_LANDSCAPE = 2;

private static Drawable getTypeImage(int type, Context context, int viewType){
Resources res = context.getResources();
switch(type){
case BOAT: return popup ? res.getDrawable(R.drawable.popup_boat) : res.getDrawable(R.drawable.drag_boat);
case CASTLE: return popup ? res.getDrawable(R.drawable.popup_castle) : res.getDrawable(R.drawable.drag_castle);
case CIVIL: return popup ? res.getDrawable(R.drawable.popup_city) : res.getDrawable(R.drawable.drag_city);
case MONUMENT: return popup ? res.getDrawable(R.drawable.popup_monument) : res.getDrawable(R.drawable.drag_monument);
case RELIGIOUS: return popup ? res.getDrawable(R.drawable.popup_religion) : res.getDrawable(R.drawable.drag_religion);
case THEATRE: return popup ? res.getDrawable(R.drawable.popup_theater) : res.getDrawable(R.drawable.drag_theater);
case TOWER: return popup ? res.getDrawable(R.drawable.popup_skyscraper) : res.getDrawable(R.drawable.drag_skyscraper);
default: return popup ? res.getDrawable(R.drawable.popup_monument) : res.getDrawable(R.drawable.drag_monument);
case BOAT: return res.getDrawable(getCorrectImageId(R.drawable.drag_boat,R.drawable.popup_boat,R.drawable.popup_boat_land,viewType));
case CASTLE: return res.getDrawable(getCorrectImageId(R.drawable.drag_castle,R.drawable.popup_castle,R.drawable.popup_castle_land,viewType));
case CIVIL: return res.getDrawable(getCorrectImageId(R.drawable.drag_city,R.drawable.popup_city,R.drawable.popup_city_land,viewType));
case MONUMENT: return res.getDrawable(getCorrectImageId(R.drawable.drag_monument,R.drawable.popup_monument,R.drawable.popup_monument_land,viewType));
case RELIGIOUS: return res.getDrawable(getCorrectImageId(R.drawable.drag_religion,R.drawable.popup_religion,R.drawable.popup_religion_land,viewType));
case THEATRE: return res.getDrawable(getCorrectImageId(R.drawable.drag_theater,R.drawable.popup_theater,R.drawable.popup_theater_land,viewType));
case TOWER: return res.getDrawable(getCorrectImageId(R.drawable.drag_skyscraper,R.drawable.popup_skyscraper,R.drawable.popup_skyscraper_land,viewType));
default: return res.getDrawable(getCorrectImageId(R.drawable.drag_monument,R.drawable.popup_monument,R.drawable.popup_default_land,viewType));
}
}

private static int getCorrectImageId(int drag, int popupPortrait, int popupLandscape,int viewType){
if(viewType == DRAG_HANDLE){
return drag;
}else if(viewType == POPUP_PORTRAIT){
return popupPortrait;
}else{
return popupLandscape;
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/add.png
Binary file added app/src/main/res/drawable/popup_boat_land.png
Binary file added app/src/main/res/drawable/popup_castle_land.png
Binary file added app/src/main/res/drawable/popup_city_land.png
Binary file added app/src/main/res/drawable/popup_default_land.png
Binary file added app/src/main/res/drawable/popup_monument_land.png
Binary file added app/src/main/res/drawable/popup_religion_land.png
Binary file added app/src/main/res/drawable/popup_theater_land.png
216 changes: 216 additions & 0 deletions app/src/main/res/layout-land/activity_monument_detail.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/cntMonumentView"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="be.artoria.belfortapp.activities.MonumentDetailActivity"
tools:ignore="MergeRootFrame" >

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

<RelativeLayout
android:layout_width="match_parent"
android:layout_weight="1"
android:layout_height="@dimen/monument_detail_image_height"
tools:visibility="gone"
android:id="@+id/prgWait">

<ProgressBar
android:layout_width="match_parent"
android:layout_height="match_parent"
android:indeterminate="true"
android:gravity="center"
android:padding="0dp"/>
</RelativeLayout>

<RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:id="@+id/cntImage">

<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/imageView"
tools:src="@drawable/img_not_found"
android:padding="0dp"
android:layout_alignParentTop="true"
android:scaleType="centerCrop"
android:layout_gravity="center"/>
</RelativeLayout>

<ImageView
android:id="@+id/imgType"
android:layout_width="100dp"
android:layout_height="50dp"
android:layout_marginLeft="-50dp"
android:layout_marginTop="-1dp"
android:src="@drawable/popup_default_land"
android:background="@null"
android:scaleType="centerCrop" />

<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_marginLeft="5dp"
android:orientation="vertical">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:id="@+id/monument_name_smaller"
tools:text="testtest"
android:layout_below="@+id/cntImage"
android:layout_centerHorizontal="true"
android:layout_marginLeft="15dp"
android:layout_marginBottom="5dp"
android:layout_marginTop="10dp"/>

<!--spacer object -->
<LinearLayout
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1"></LinearLayout>

<ImageButton
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginRight="10dp"
android:layout_marginTop="5dp"
android:src="@drawable/add"
android:scaleType="fitXY"
android:background="@null"
android:id="@+id/add_to_route"
android:onClick="addToRoute"/>

</LinearLayout>

<TextView
android:layout_marginTop="15dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:text="THIS IS TOOLS:TEXT\n cool\n\n\t\they"
android:id="@+id/monument_description"/>
</LinearLayout>

</LinearLayout>





<!--
<ImageView
android:id="@+id/imgType"
android:layout_width="50dp"
android:layout_height="100dp"
android:src="@drawable/popup_boat"
android:layout_alignParentLeft="true"
android:scaleType="centerCrop"
android:layout_marginLeft="-3dp"
android:layout_below="@+id/cntImage"
android:layout_marginTop="-50dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:id="@+id/monument_name_smaller"
tools:text="testtest"
android:layout_below="@+id/cntImage"
android:layout_centerHorizontal="true"
android:layout_marginLeft="15dp"
android:layout_marginBottom="5dp"
android:layout_marginTop="10dp"
android:layout_toRightOf="@+id/imgType"/>
<LinearLayout
android:padding="5dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/imgType"
android:layout_above="@+id/ftrMonument"
android:minHeight="200dp"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="THIS IS TOOLS:TEXT\n cool\n\n\t\they"
android:id="@+id/monument_description"
android:maxHeight="200dp"
android:layout_weight="1"/>
</LinearLayout>
<LinearLayout
android:id="@+id/ftrMonument"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp">
<ImageButton
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@drawable/left"
android:id="@+id/prev"
android:scaleType="centerCrop"
style="@style/lightButtonStyle"
android:layout_marginLeft="10dp"
android:onClick="prevDetail"/>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center"
android:gravity="center">
<ImageButton
android:layout_width="170dp"
android:layout_height="50dp"
android:src="@drawable/add_to_route"
android:scaleType="fitXY"
android:background="@null"
android:id="@+id/add_to_route"
android:onClick="addToRoute"
android:layout_centerInParent="true"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/add_to_route"
android:layout_centerInParent="true"
android:textStyle="bold"
android:textColor="#FFFFFF"
android:textSize="16dp"/>
</RelativeLayout>
<ImageButton
android:layout_width="50dp"
android:layout_height="50dp"
android:id="@+id/next"
android:onClick="nextDetail"
style="@style/lightButtonStyle"
android:scaleType="centerCrop"
android:src="@drawable/right"
android:layout_marginRight="10dp"
/>
</LinearLayout>
-->
</RelativeLayout>
1 change: 1 addition & 0 deletions app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<string name="destination">destination</string>
<string name="no_route">Il n\'y a pas de waypoints sur votre itinéraire, s\'il vous plaît ajouter des waypoints à votre itinéraire en appuyant panorama ou bâtiments</string>
<string name="dataset_url">https://raw.githubusercontent.com/oSoc14/ArtoriaData/master/poi.json</string>
<string name="monument_landscape_msg">Balayez vers la gauche ou la droite pour naviguer entre les bâtiments</string>

<string-array name="lstMenu">
<item>Panorama</item>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-nl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<string name="add_to_route">Toevoegen aan route</string>
<string name="destination">bestemming</string>
<string name="no_route">Er zijn nog geen bestemmingen in uw route, gelieve deze toe te voegen door te klikken op panorama of gebouwen</string>
<string name="monument_landscape_msg">Veeg links of rechts om te navigeren tussen de gebouwen</string>

<string name="calcRoute">Bereken route</string>
<string name="view_route">Mijn route</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<string name="destination">destination</string>
<string name="no_route">There are no waypoints on your route, please add some waypoints to your route by tapping panorama or buildings</string>
<string name="dataset_url">https://raw.githubusercontent.com/oSoc14/ArtoriaData/master/poi.json</string>
<string name="monument_landscape_msg">Swipe left or right to navigate between the buildings</string>

<string-array name="lstMenu">
<item>Panorama</item>
Expand Down

0 comments on commit 51171d7

Please sign in to comment.