Skip to content

Commit

Permalink
New app icon.
Browse files Browse the repository at this point in the history
  • Loading branch information
frigus02 committed Aug 26, 2017
1 parent a73b7da commit d3ceff5
Show file tree
Hide file tree
Showing 26 changed files with 878 additions and 1,209 deletions.
3 changes: 3 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Jan Kuehle <[email protected]>
Jan Kuehle <[email protected]> <[email protected]>
Jan Kuehle <[email protected]> <Jan@Jan-Desktop>
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Car Report

## Description
> Android app for saving and looking up costs (refuelings, ...) of your car.
Car Report is an android app, which lets you enter refuelings and other income and expenses of your
cars and displays nice reports. The following are currently included:
Expand All @@ -16,15 +16,15 @@ inspection once a year.
It provides synchronization with Dropbox and Google Drive and has basic backup/restore and CSV
import/export functionality.

## Get it
## Install

[Car Report on Play Store](https://play.google.com/store/apps/details?id=me.kuehle.carreport)
*(This is the full version.)*

[Car Report on F-Droid](https://f-droid.org/repository/browse/?fdid=me.kuehle.carreport)
*(This is a special FOSS version without Google Drive sync.)*

## Build it
## Build

The app uses gradle, so to build it just open a command line, switch to the app directory and
execute one of the following commands.
Expand All @@ -42,3 +42,7 @@ although they are not used for compiling. If you don't have these libraries avai
to temporary remove all lines prefixed with ```fullCompile``` from the *build.gradle* file in the
app folder. See [this comment](https://bitbucket.org/frigus02/car-report/issues/53/dependence-on-proprietary-components#comment-21959839)
for more information.

## License

[Apache 2.0 © Jan Kühle.](../COPYING)
20 changes: 20 additions & 0 deletions app/src/main/assets/thanks.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<div>
André Marcelo Alvarenga<br>
<i>for the brazilian portuguese (pt_BR) translation.</i>
</div>
<div>
gluon9<br>
<i>for the french (fr) translation.</i>
</div>
<div>
Igor Almeida<br>
<i>for the help with F-Droid.</i>
</div>
<div>
Jesper Runeson<br>
<i>for the amazing app icon.</i>
</div>
<div>
Mihai Ibanescu<br>
<i>for the Fuel Consumption setting.</i>
</div>
23 changes: 8 additions & 15 deletions app/src/main/java/me/kuehle/carreport/gui/HelpActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,22 @@
import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.support.v7.widget.Toolbar;
import android.text.Html;
import android.text.Spanned;
import android.text.method.LinkMovementMethod;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import java.util.Locale;

import me.kuehle.carreport.R;
import me.kuehle.carreport.util.Assets;

public class HelpActivity extends PreferenceActivity {
private static final String TAG = "HelpActivity";

private Toolbar mActionBar;

@Override
Expand Down Expand Up @@ -88,17 +85,13 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
TextView text = (TextView) v.findViewById(android.R.id.text1);
text.setMovementMethod(LinkMovementMethod.getInstance());

try {
InputStream in = getActivity().getAssets().open(
String.format("%s/%s.html", getLocalizedDirectory("help"), getHelpId()));
byte[] buffer = new byte[in.available()];
in.read(buffer);
in.close();
String assetPath = String.format(
"%s/%s.html",
getLocalizedDirectory("help"),
getHelpId());
Spanned html = Assets.getHtml(getActivity(), assetPath);

text.setText(Html.fromHtml(new String(buffer)));
} catch (IOException e) {
Log.e(TAG, "Error reading help html file.", e);
}
text.setText(html);

return v;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,17 @@

import android.app.Fragment;
import android.os.Bundle;
import android.text.Spanned;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;

import de.psdev.licensesdialog.LicensesDialog;
import de.psdev.licensesdialog.licenses.MITLicense;
import de.psdev.licensesdialog.model.Notice;
import me.kuehle.carreport.BuildConfig;
import me.kuehle.carreport.R;
import me.kuehle.carreport.util.Assets;

public class PreferencesAboutFragment extends Fragment {
private View.OnClickListener licensesOnClickListener = new View.OnClickListener() {
Expand All @@ -48,10 +49,17 @@ public void onClick(View v) {
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View root = inflater.inflate(R.layout.fragment_prefs_about, container, false);
TextView txtVersion = (TextView) root.findViewById(R.id.txt_version);
TextView txtThanks = (TextView) root.findViewById(R.id.txt_thanks);
Button btnLicenses = (Button) root.findViewById(R.id.btn_licenses);

String strVersion = getString(R.string.about_version, BuildConfig.VERSION_NAME);
((TextView) root.findViewById(R.id.txt_version)).setText(strVersion);
root.findViewById(R.id.btn_licenses).setOnClickListener(licensesOnClickListener);
txtVersion.setText(strVersion);

Spanned htmlThanks = Assets.getHtml(getActivity(), "thanks.html");
txtThanks.setText(htmlThanks);

btnLicenses.setOnClickListener(licensesOnClickListener);

return root;
}
Expand Down
45 changes: 45 additions & 0 deletions app/src/main/java/me/kuehle/carreport/util/Assets.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Copyright 2017 Jan Kühle
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package me.kuehle.carreport.util;

import android.content.Context;
import android.text.Html;
import android.text.Spanned;
import android.util.Log;

import java.io.IOException;
import java.io.InputStream;

public class Assets {
private static final String TAG = "Assets";

public static Spanned getHtml(Context context, String path) {
String result;
try {
InputStream in = context.getAssets().open(path);
byte[] buffer = new byte[in.available()];
in.read(buffer);
in.close();

result = new String(buffer);
} catch (IOException e) {
Log.e(TAG, "Error reading help html file.", e);
result = "Error reading help html file.";
}

return Html.fromHtml(result);
}
}
Binary file modified app/src/main/res/drawable-hdpi/ic_c_launcher_48dp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/drawable-mdpi/ic_c_launcher_48dp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/drawable-xhdpi/ic_c_launcher_48dp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/drawable-xxhdpi/ic_c_launcher_48dp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/drawable-xxxhdpi/ic_c_launcher_48dp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 21 additions & 14 deletions app/src/main/res/layout/fragment_prefs_about.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,51 +15,58 @@
limitations under the License.
-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="16dp" >
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="16dp">

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

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:contentDescription="@string/app_name"
android:src="@drawable/ic_c_launcher_80dp" />
android:src="@drawable/ic_c_launcher_96dp"/>

<TextView
android:id="@+id/txt_version"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp"
android:text="@string/about_version" />
android:text="@string/about_version"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="@string/about_author" />
android:text="@string/about_author"/>

<Button
android:id="@+id/btn_licenses"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="16dp"
android:text="@string/about_licenses"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="20dp"
android:layout_marginTop="20dp"
android:gravity="center"
android:text="@string/about_description" />
android:layout_marginTop="16dp"
android:text="@string/about_thanks"/>

<Button
android:id="@+id/btn_licenses"
<TextView
android:id="@+id/txt_thanks"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="@string/about_licenses" />
tools:text="John Doe\n- App Icon"/>
</LinearLayout>

</ScrollView>
2 changes: 1 addition & 1 deletion app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
-->
<resources>
<string name="about_author">© Jan Kühle</string>
<string name="about_thanks">Danke an:</string>
<string name="about_version">Version: %s</string>
<string name="about_description">Tragen Sie die laufenden Kosten Ihres Autos ein und erhalten Sie schöne Reports.</string>
<string name="about_licenses">Lizenzen</string>

<string name="drawer_reports">Reports</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

<string name="about_author">© Jan Kühle</string>
<string name="about_version">Version: %s</string>
<string name="about_description">Entrer les coûts de votre voiture et recever de jolies rapports et statistiques.</string>
<string name="about_licenses">Licenses</string>

<string name="drawer_reports">Rapports</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-pt-rBR/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
<resources>
<string name="about_author">© Jan Kühle</string>
<string name="about_version">Versão: %s</string>
<string name="about_description">Indique os custos do seu veículo e receba relatórios e estatísticas.</string>
<string name="about_licenses">Licenças</string>

<string name="drawer_reports">Relatórios</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
<string name="app_description" translatable="false">Enter the costs of your car and receive nice reports and statistics.</string>

<string name="about_author">© Jan Kühle</string>
<string name="about_thanks">Thanks to:</string>
<string name="about_version">Version: %s</string>
<string name="about_description">Enter the costs of your car and receive nice reports and statistics.</string>
<string name="about_licenses">Licenses</string>

<string name="drawer_reports">Reports</string>
Expand Down
34 changes: 34 additions & 0 deletions resources/export-pngs.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
$Inkscape = "C:\Program Files\Inkscape\inkscape.com"
$Resources = "$PSScriptRoot"
$Destination = Join-Path $PSScriptRoot "..\app\src\main\res"


Write-Host -----------------------------------------------
Write-Host ic_c_launcher_48dp
Write-Host -----------------------------------------------

$Sizes = @( "xxxhdpi", "xxhdpi", "xhdpi", "hdpi", "mdpi" )
foreach ($size in $Sizes)
{
& $Inkscape `
--without-gui `
--export-png="$Destination\drawable-$size\ic_c_launcher_48dp.png" `
--export-id="e-$size" `
--export-dpi=96 `
"$Resources\ic_launcher.svg"
}

Write-Host -----------------------------------------------
Write-Host ic_c_launcher_80dp
Write-Host -----------------------------------------------

$Sizes = @( "xxhdpi", "xhdpi", "hdpi", "mdpi" )
foreach ($size in $Sizes)
{
& $Inkscape `
--without-gui `
--export-png="$Destination\drawable-$size\ic_c_launcher_96dp.png" `
--export-id="e-$size" `
--export-dpi=192 `
"$Resources\ic_launcher.svg"
}
1,895 changes: 726 additions & 1,169 deletions resources/ic_launcher.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d3ceff5

Please sign in to comment.