Skip to content

Commit 6a58d7f

Browse files
authored
Merge pull request #8 from midhunhk/atlantis
Atlantis
2 parents a3b210a + 1e2043a commit 6a58d7f

File tree

8 files changed

+153
-11
lines changed

8 files changed

+153
-11
lines changed

app/build.gradle

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
apply plugin: 'com.android.application'
22

33
android {
4+
signingConfigs {
5+
config {
6+
}
7+
}
48
compileSdkVersion 25
59
buildToolsVersion "25.0.1"
610
defaultConfig {
@@ -20,9 +24,8 @@ android {
2024
}
2125
compileOptions {
2226
}
23-
24-
applicationVariants.all{ variant ->
25-
variant.outputs.each{ output ->
27+
applicationVariants.all { variant ->
28+
variant.outputs.each { output ->
2629
output.outputFile = new File(
2730
output.outputFile.parent,
2831
output.outputFile.name.replace(".apk", "-${variant.versionName}-${variant.versionCode}.apk"))

app/src/main/java/com/ae/apps/tripmeter/activities/AboutActivity.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ of this software and associated documentation files (the "Software"), to deal
2323
*/
2424
package com.ae.apps.tripmeter.activities;
2525

26+
import android.app.AlertDialog;
27+
import android.content.Context;
28+
import android.content.DialogInterface;
2629
import android.content.Intent;
2730
import android.net.Uri;
2831
import android.os.Bundle;
@@ -60,12 +63,25 @@ public void onClick(View view) {
6063
}
6164
});
6265

66+
final Context context = this;
6367
// Show the License
6468
Button viewLicenseBtn = (Button) findViewById(R.id.viewLicense);
6569
viewLicenseBtn.setOnClickListener(new View.OnClickListener(){
6670
@Override
6771
public void onClick(View view) {
72+
// Will use from ae-apps-lib in future
73+
AlertDialog.Builder builder = new AlertDialog.Builder(context)
74+
.setCancelable(true)
75+
.setTitle(R.string.menu_license)
76+
.setMessage(R.string.str_license)
77+
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
6878

79+
@Override
80+
public void onClick(DialogInterface dialog, int which) {
81+
dialog.dismiss();
82+
}
83+
});
84+
builder.show();
6985
}
7086
});
7187
}

app/src/main/java/com/ae/apps/tripmeter/activities/MainActivity.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import com.ae.apps.tripmeter.R;
3939
import com.ae.apps.tripmeter.fragments.FuelCalcFragment;
4040
import com.ae.apps.tripmeter.fragments.FuelPricesFragment;
41+
import com.ae.apps.tripmeter.fragments.TripExpensesFragment;
4142

4243
/**
4344
* The Main Activity
@@ -89,9 +90,11 @@ private void updateDisplayedFragment(int itemId) {
8990
break;
9091
// Both items below point to coming soon fragments
9192
case R.id.action_fuel_price:
92-
case R.id.action_trip_expenses:
9393
fragment = FuelPricesFragment.newInstance("", "");
9494
break;
95+
case R.id.action_trip_expenses:
96+
fragment = TripExpensesFragment.newInstance();
97+
break;
9598
}
9699

97100
final FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package com.ae.apps.tripmeter.fragments;
2+
3+
4+
import android.os.Bundle;
5+
import android.support.v4.app.Fragment;
6+
import android.view.LayoutInflater;
7+
import android.view.View;
8+
import android.view.ViewGroup;
9+
10+
import com.ae.apps.tripmeter.R;
11+
12+
/**
13+
* A simple {@link Fragment} subclass.
14+
* Use the {@link TripExpensesFragment#newInstance} factory method to
15+
* create an instance of this fragment.
16+
*/
17+
public class TripExpensesFragment extends Fragment {
18+
19+
public TripExpensesFragment() {
20+
// Required empty public constructor
21+
}
22+
23+
/**
24+
* @return A new instance of fragment TripExpensesFragment.
25+
*/
26+
public static TripExpensesFragment newInstance() {
27+
return new TripExpensesFragment();
28+
}
29+
30+
@Override
31+
public void onCreate(Bundle savedInstanceState) {
32+
super.onCreate(savedInstanceState);
33+
}
34+
35+
@Override
36+
public View onCreateView(LayoutInflater inflater, ViewGroup container,
37+
Bundle savedInstanceState) {
38+
return inflater.inflate(R.layout.fragment_trip_expenses, container, false);
39+
}
40+
41+
}

app/src/main/res/layout/fragment_fuel_prices.xml

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,27 @@
1414
app:cardUseCompatPadding="true"
1515
app:contentPadding="@dimen/cardview_content_padding">
1616

17-
<TextView
17+
<LinearLayout
1818
android:layout_width="match_parent"
19-
android:layout_height="match_parent"
20-
android:gravity="center_vertical"
21-
android:layout_gravity="center_vertical"
22-
android:drawableTop="@android:drawable/ic_dialog_alert"
23-
android:drawablePadding="@dimen/fab_margin"
24-
android:text="@string/str_feature_placeholder"/>
19+
android:layout_height="wrap_content"
20+
android:orientation="vertical">
21+
22+
<TextView
23+
android:layout_width="match_parent"
24+
android:layout_height="match_parent"
25+
android:layout_gravity="center_vertical"
26+
android:gravity="center_vertical"
27+
android:text="@string/menu_fuel_price"/>
28+
29+
<TextView
30+
android:layout_width="match_parent"
31+
android:layout_height="match_parent"
32+
android:layout_gravity="center_vertical"
33+
android:drawablePadding="@dimen/fab_margin"
34+
android:drawableTop="@android:drawable/ic_secure"
35+
android:gravity="center_vertical"
36+
android:textAlignment="center"
37+
android:text="@string/str_feature_placeholder"/>
38+
</LinearLayout>
2539
</android.support.v7.widget.CardView>
2640
</FrameLayout>
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:app="http://schemas.android.com/apk/res-auto"
3+
xmlns:tools="http://schemas.android.com/tools"
4+
android:layout_width="match_parent"
5+
android:layout_height="match_parent"
6+
tools:context="com.ae.apps.tripmeter.fragments.FuelPricesFragment">
7+
8+
<android.support.v7.widget.CardView
9+
android:layout_width="match_parent"
10+
android:layout_height="wrap_content"
11+
android:layout_marginLeft="@dimen/activity_horizontal_margin"
12+
android:layout_marginRight="@dimen/activity_horizontal_margin"
13+
android:layout_marginTop="@dimen/activity_vertical_margin"
14+
app:cardUseCompatPadding="true"
15+
app:contentPadding="@dimen/cardview_content_padding">
16+
17+
<LinearLayout
18+
android:layout_width="match_parent"
19+
android:layout_height="wrap_content"
20+
android:orientation="vertical">
21+
22+
<TextView
23+
android:layout_width="match_parent"
24+
android:layout_height="match_parent"
25+
android:layout_gravity="center_vertical"
26+
android:gravity="center_vertical"
27+
android:text="@string/menu_trip_expenses"/>
28+
29+
<TextView
30+
android:layout_width="match_parent"
31+
android:layout_height="match_parent"
32+
android:layout_gravity="center_vertical"
33+
android:drawablePadding="@dimen/fab_margin"
34+
android:drawableTop="@android:drawable/ic_secure"
35+
android:gravity="center_vertical"
36+
android:textAlignment="center"
37+
android:text="@string/str_feature_placeholder"/>
38+
</LinearLayout>
39+
</android.support.v7.widget.CardView>
40+
</FrameLayout>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<string name="str_license">MIT License\n\n
4+
Permission is hereby granted, free of charge, to any person obtaining a copy
5+
of this software and associated documentation files (the "Software"), to deal
6+
in the Software without restriction, including without limitation the rights
7+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
copies of the Software, and to permit persons to whom the Software is
9+
furnished to do so, subject to the following conditions:\n\n
10+
11+
The above copyright notice and this permission notice shall be included in all
12+
copies or substantial portions of the Software.\n\n
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
SOFTWARE.
21+
</string>
22+
</resources>

app/src/main/res/values/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,7 @@
107107

108108
<string name="pref_title_vibrate">Vibrate</string>
109109

110+
<!-- TODO: Remove or change this placeholder text -->
111+
<string name="hello_blank_fragment">Hello blank fragment</string>
112+
110113
</resources>

0 commit comments

Comments
 (0)