Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration path #88

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
compileSdkVersion 31
buildToolsVersion "30.0.3"

defaultConfig {
applicationId "ch.fixme.status"
minSdkVersion 21
targetSdkVersion 29
targetSdkVersion 31
versionCode 20
versionName "1.8.1"
}
Expand Down
14 changes: 9 additions & 5 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,16 @@
<activity
android:name=".Main"
android:label="@string/app_name"
android:launchMode="singleTask">
android:launchMode="singleTask"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity
android:name=".NewVersionActivity"
android:exported="false" />
<activity
android:name=".Prefs"
android:label="@string/app_name"
Expand All @@ -39,20 +42,21 @@

<activity
android:name=".Widget_config"
android:label="@string/app_name">
android:label="@string/app_name"
android:exported="false">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
</intent-filter>
</activity>

<receiver android:name=".Network">
<receiver android:name=".Network" android:exported="false">
<intent-filter>
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
</intent-filter>
</receiver>

<receiver android:name=".Widget">
<receiver android:name=".Widget" android:exported="false">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
Expand Down
7 changes: 7 additions & 0 deletions app/src/main/java/ch/fixme/status/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import android.net.http.HttpResponseCache;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.preference.PreferenceManager;
import android.text.util.Linkify;
import android.util.Log;
Expand Down Expand Up @@ -110,6 +111,12 @@ public void onCreate(Bundle savedInstanceState) {
showError(getString(R.string.error_title) + getString(R.string.error_network_title),
getString(R.string.error_network_msg));
}

// Show info about new app after 1s
new Handler().postDelayed(() -> {
final Intent intent = new Intent(this, NewVersionActivity.class);
startActivity(intent);
}, 1000);
}

@Override
Expand Down
27 changes: 27 additions & 0 deletions app/src/main/java/ch/fixme/status/NewVersionActivity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package ch.fixme.status;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ImageView;

public class NewVersionActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_new_version);

// Close button
final ImageView closeButton = findViewById(R.id.closeButton);
closeButton.setImageResource(R.drawable.ic_baseline_close_24);
closeButton.setOnClickListener(buttonView -> finish());

// Logos
final ImageView oldLogo = findViewById(R.id.oldLogo);
oldLogo.setImageResource(R.drawable.myhs);
final ImageView arrow = findViewById(R.id.arrow);
arrow.setImageResource(R.drawable.ic_baseline_arrow_forward_24);
final ImageView newLogo = findViewById(R.id.newLogo);
newLogo.setImageResource(R.drawable.newlogo);
}
}
5 changes: 5 additions & 0 deletions app/src/main/res/drawable/ic_baseline_arrow_forward_24.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector android:autoMirrored="true" android:height="24dp"
android:tint="#505050" android:viewportHeight="24"
android:viewportWidth="24" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M12,4l-1.41,1.41L16.17,11H4v2h12.17l-5.58,5.59L12,20l8,-8z"/>
</vector>
5 changes: 5 additions & 0 deletions app/src/main/res/drawable/ic_baseline_close_24.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#505050"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/>
</vector>
Binary file added app/src/main/res/drawable/newlogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
101 changes: 101 additions & 0 deletions app/src/main/res/layout/activity_new_version.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@android:color/white"
tools:context=".NewVersionActivity">

<ImageView
android:id="@+id/closeButton"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_margin="8dp"
android:layout_gravity="end" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="24dp"
android:textStyle="bold"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:text="Please switch to new app" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_horizontal">
<ImageView
android:id="@+id/oldLogo"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center" />
<ImageView
android:id="@+id/arrow"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_marginStart="24dp"
android:layout_gravity="center" />
<ImageView
android:id="@+id/newLogo"
android:layout_width="128dp"
android:layout_height="128dp"
android:layout_gravity="center_horizontal" />
</LinearLayout>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="16dp"
android:text="The MyHackerspace app is moving! After many years of development by @rorist from FIXME Lausanne, the app is now moving into the SpaceAPI-Community organization on GitHub:" />

<TextView
android:id="@+id/spaceapi_community_url"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:autoLink="web"
android:text="https://github.com/spaceapi-community/my-hackerspace/" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:text="To switch, please install the 'MyHackerspace' app with the new logo (which you can see above) from F-Droid (recommended) or Google Play." />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:autoLink="web"
android:text="- F-Droid: https://f-droid.org/en/packages/io.spaceapi.community.myhackerspace/\n- Google Play: https://play.google.com/store/apps/details?id=io.spaceapi.community.myhackerspace" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:text="Then, uninstall this app." />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="32dp"
android:text="So long, and thanks for all the fish! 👋" />

</LinearLayout>
</ScrollView>
5 changes: 3 additions & 2 deletions app/src/main/res/layout/base.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
Copyright (C) 2012 Aubort Jean-Baptiste (Rorist)
Licensed under GNU's GPL 3, see README
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/group"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingBottom="30dip"
android:orientation="vertical" >
android:orientation="vertical">

<!-- STATUS -->

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-da/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
-->
<resources>

<string name="app_name">MyHackerspace</string>
<string name="app_name">MyHackerspace (Old)</string>
<string name="empty"></string>
<string name="ok">OK</string>

Expand Down
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 @@ -9,7 +9,7 @@ Licensed under GNU's GPL 3, see README
-->
<resources>

<string name="app_name">MyHackerspace</string>
<string name="app_name">MyHackerspace (Old)</string>
<string name="empty"></string>
<string name="ok">OK</string>

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
-->
<resources>

<string name="app_name">MyHackerspace</string>
<string name="app_name">MyHackerspace (Old)</string>
<string name="empty"></string>
<string name="ok">OK</string>

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-nl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
-->
<resources>

<string name="app_name">MyHackerspace</string>
<string name="app_name">MyHackerspace (Old)</string>
<string name="empty"></string>
<string name="ok">OK</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 @@ -6,7 +6,7 @@ Licensed under GNU's GPL 3, see README
-->
<resources>

<string name="app_name">MyHackerspace</string>
<string name="app_name">MyHackerspace (Old)</string>
<string name="empty"></string>
<string name="ok">OK</string>

Expand Down