Compare commits

...

3 commits
V2.6 ... main

Author SHA1 Message Date
woheller69
10aced4a5d V2.7
SDK 35
Android 15
2025-07-01 10:01:17 +02:00
woheller69
02b78a99c9 fix potential rare crash 2025-05-23 06:27:05 +02:00
woheller69
10f7c2f9f5 Chinese translation by @ifox6677 2025-05-05 16:36:42 +02:00
29 changed files with 188 additions and 85 deletions

View file

@ -13,14 +13,16 @@ android {
includeInBundle = false
}
compileSdk 34
compileSdk 35
android.buildFeatures.buildConfig true
namespace 'org.woheller69.weather'
defaultConfig {
applicationId "org.woheller69.solxpect"
minSdkVersion 26
targetSdk 34
versionCode 26
versionName "2.6"
targetSdk 35
versionCode 27
versionName "2.7"
buildConfigField "String", "BASE_URL", "\"https://api.open-meteo.com/v1/\""
buildConfigField "String", "TILES_URL","\"https://tile.openstreetmap.org/\""
@ -40,16 +42,14 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.diogobernardino:williamchart:2.2'
implementation 'net.e175.klaus:solarpositioning:0.1.10'
implementation 'androidx.preference:preference:1.2.0'
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.preference:preference:1.2.1'
implementation 'androidx.appcompat:appcompat:1.7.1'
implementation 'com.google.android.material:material:1.12.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.android.volley:volley:1.2.1'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.recyclerview:recyclerview:1.4.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'net.lingala.zip4j:zip4j:2.9.1'
implementation "androidx.lifecycle:lifecycle-viewmodel:2.5.1" //needed due to duplicate class error
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1" //needed due to duplicate class error
implementation 'com.github.woheller69:CompassView:948f3db329'
implementation 'androidx.webkit:webkit:1.5.0'
}

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.woheller69.weather">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" />

View file

@ -1,7 +1,9 @@
package org.woheller69.weather.activities;
import android.os.Build;
import android.os.Bundle;
import android.text.method.LinkMovementMethod;
import android.view.WindowInsetsController;
import android.widget.TextView;
import org.woheller69.weather.BuildConfig;
@ -15,6 +17,12 @@ public class AboutActivity extends NavigationActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about);
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
getWindow().getInsetsController().setSystemBarsAppearance(
WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS,
WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS
);
}
((TextView) findViewById(R.id.openmeteoURL)).setMovementMethod(LinkMovementMethod.getInstance());
((TextView) findViewById(R.id.githubURL)).setMovementMethod(LinkMovementMethod.getInstance());

View file

@ -9,6 +9,7 @@ import android.os.Bundle;
import android.os.Environment;
import android.view.Gravity;
import android.view.View;
import android.view.WindowInsetsController;
import android.widget.Toast;
import androidx.activity.result.ActivityResultLauncher;
@ -33,7 +34,12 @@ public class BackupRestoreActivity extends NavigationActivity{
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_backuprestore);
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
getWindow().getInsetsController().setSystemBarsAppearance(
WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS,
WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS
);
}
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {

View file

@ -3,6 +3,7 @@ package org.woheller69.weather.activities;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Build;
import android.os.Bundle;
import androidx.appcompat.app.AlertDialog;
@ -16,6 +17,7 @@ import androidx.viewpager2.widget.ViewPager2;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.WindowInsetsController;
import android.view.animation.Animation;
import android.view.animation.LinearInterpolator;
import android.view.animation.RotateAnimation;
@ -93,6 +95,12 @@ public class ForecastCityActivity extends NavigationActivity implements IUpdatea
super.onCreate(savedInstanceState);
context=this;
setContentView(R.layout.activity_forecast_city);
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
getWindow().getInsetsController().setSystemBarsAppearance(
WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS,
WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS
);
}
initResources();

View file

@ -3,6 +3,7 @@ package org.woheller69.weather.activities;
import android.content.res.AssetManager;
import android.os.Build;
import android.os.Bundle;
import android.view.WindowInsetsController;
import android.webkit.WebView;
import org.woheller69.weather.R;
@ -20,6 +21,13 @@ public class HelpActivity extends NavigationActivity{
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_help);
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
getWindow().getInsetsController().setSystemBarsAppearance(
WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS,
WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS
);
}
WebView view = findViewById(R.id.help);
if(WebViewFeature.isFeatureSupported(WebViewFeature.ALGORITHMIC_DARKENING)) {

View file

@ -1,6 +1,7 @@
package org.woheller69.weather.activities;
import android.content.Context;
import android.os.Build;
import android.os.Bundle;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.redinput.compassview.CompassView;
@ -17,6 +18,7 @@ import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowInsetsController;
import android.view.WindowManager;
import android.widget.CheckBox;
import android.widget.EditText;
@ -62,6 +64,13 @@ public class ManageLocationsActivity extends NavigationActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_manage_locations);
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
getWindow().getInsetsController().setSystemBarsAppearance(
WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS,
WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS
);
}
context=this;
database = SQLiteHelper.getInstance(getApplicationContext());

View file

@ -4,6 +4,7 @@ package org.woheller69.weather.activities;
import android.content.SharedPreferences;
import android.os.Build;
import android.os.Bundle;
import android.view.WindowInsetsController;
import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;
@ -40,7 +41,12 @@ public class SettingsActivity extends NavigationActivity implements SharedPrefer
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_settings);
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
getWindow().getInsetsController().setSystemBarsAppearance(
WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS,
WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS
);
}
}
@Override

View file

@ -14,6 +14,7 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowInsetsController;
import android.view.WindowManager;
import android.widget.Button;
@ -46,7 +47,12 @@ public class TutorialActivity extends AppCompatActivity {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_tutorial);
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
getWindow().getInsetsController().setSystemBarsAppearance(
WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS,
WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS
);
}
viewPager = (ViewPager) findViewById(R.id.view_pager);
dotsLayout = (LinearLayout) findViewById(R.id.layoutDots);
btnNext = (Button) findViewById(R.id.btn_next);
@ -62,8 +68,6 @@ public class TutorialActivity extends AppCompatActivity {
// adding bottom dots
addBottomDots(0);
// making notification bar transparent
changeStatusBarColor();
myViewPagerAdapter = new MyViewPagerAdapter();
viewPager.setAdapter(myViewPagerAdapter);
@ -158,17 +162,6 @@ public class TutorialActivity extends AppCompatActivity {
}
};
/**
* Making notification bar transparent
*/
private void changeStatusBarColor() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Window window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(Color.TRANSPARENT);
}
}
/**
* View pager adapter
*/

View file

@ -311,6 +311,7 @@ public class CityWeatherAdapter extends RecyclerView.Adapter<CityWeatherAdapter.
new RecyclerItemClickListener(context, holder.recyclerView, new RecyclerItemClickListener.OnItemClickListener() {
@Override
public void onItemClick(View view, int position) {
if (position == -1) return;
SQLiteHelper database = SQLiteHelper.getInstance(context.getApplicationContext());
List<WeekForecast> weekforecasts = database.getWeekForecastsByCityId(generalDataList.getCity_id());
long time = weekforecasts.get(position).getForecastTime(); //time of clicked week item

View file

@ -5,7 +5,6 @@
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<androidx.coordinatorlayout.widget.CoordinatorLayout

View file

@ -5,7 +5,6 @@
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<androidx.coordinatorlayout.widget.CoordinatorLayout

View file

@ -5,7 +5,6 @@
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<androidx.coordinatorlayout.widget.CoordinatorLayout

View file

@ -5,7 +5,6 @@
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<androidx.coordinatorlayout.widget.CoordinatorLayout

View file

@ -5,7 +5,6 @@
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<include

View file

@ -1,40 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
tools:context=".activities.RainViewerActivity"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@color/backgroundBlue"
android:orientation="horizontal">
<ImageButton
android:id="@+id/rainviewer_prev"
android:layout_width="wrap_content"
android:layout_weight="1"
android:src="@drawable/ic_skip_previous_24px"
android:layout_height="wrap_content" />
<ImageButton
android:id="@+id/rainviewer_startstop"
android:layout_width="wrap_content"
android:layout_weight="3"
android:src="@drawable/ic_playpause"
android:layout_height="wrap_content" />
<ImageButton
android:id="@+id/rainviewer_next"
android:layout_width="wrap_content"
android:layout_weight="1"
android:src="@drawable/ic_skip_next_24px"
android:layout_height="wrap_content" />
</LinearLayout>
<WebView
android:id="@+id/webView"
android:layout_width="match_parent"
android:layout_height="fill_parent" />
</LinearLayout>

View file

@ -5,7 +5,6 @@
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<androidx.coordinatorlayout.widget.CoordinatorLayout

View file

@ -1,7 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<androidx.viewpager.widget.ViewPager

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">solXpect</string>
<string name="about">Über</string>
<string name="about_privacy_heading">Privatsphäre-Informationen</string>
<string name="about_more_info">Mehr Informationen können gefunden werden auf:</string>

View file

@ -1,5 +1,4 @@
<resources>
<string name="app_name">solXpect</string>
<string name="activity_about">Info</string>
<string name="activity_settings">Impostazioni</string>
<string name="activity_weather">Previsione</string>

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorStatusBar">#181818</color>
<color name="colorPrimary">#181818</color>
<color name="colorPrimaryDark">#777777</color>
<color name="colorAccent">#a0a0a0</color>

View file

@ -1,5 +1,4 @@
<resources>
<string name="app_name">solXpect</string>
<string name="activity_about">Hakkında</string>
<string name="activity_settings">Ayarlar</string>
<string name="activity_weather">Tahmin</string>

View file

@ -0,0 +1,115 @@
<resources>
<string name="app_name">发电预测</string>
<string name="activity_about">关于</string>
<string name="activity_settings">设置</string>
<string name="activity_weather">天气预报</string>
<string name="activity_manage">管理位置</string>
<string name="action_refresh">刷新</string>
<string name="navigation_drawer_open">打开导航抽屉</string>
<string name="navigation_drawer_close">关闭导航抽屉</string>
<string name="next">下一步</string>
<string name="okay">确定</string>
<string name="slide1_heading">欢迎!</string>
<string name="slide1_text">太阳能预测可预测您的太阳能发电站输出</string>
<string name="slide2_text">本应用的源代码可在GitHub获取。更多说明请查看关于页面。</string>
<string name="card_week_heading">本周</string>
<string name="card_error_heading">获取天气数据错误</string>
<string name="card_error_content">请尝试更新!</string>
<string name="about_privacy_heading">隐私信息</string>
<string name="about">关于</string>
<string name="version_number">版本号</string>
<string name="about_license">许可证</string>
<string name="about_license_text">本应用衍生自SECUSO研究小组开发的Privacy Friendly Weather。源代码采用GPLv3许可。应用使用的图标来自Google Material Design IconsApache 2.0许可、Leaflet库BSD 2条款许可、AutoSuggestTextViewAPICallApache 2.0许可、SolarpositioningMIT许可、Zip4jApache 2.0许可、CompassViewApache 2.0许可和WilliamChart库Apache 2.0许可)</string>
<string name="about_more_info">更多信息请访问:</string>
<string name="activity_settings_title">设置</string>
<string name="abbreviation_monday">周一</string>
<string name="abbreviation_tuesday">周二</string>
<string name="abbreviation_wednesday">周三</string>
<string name="abbreviation_thursday">周四</string>
<string name="abbreviation_friday">周五</string>
<string name="abbreviation_saturday">周六</string>
<string name="abbreviation_sunday">周日</string>
<string name="dialog_add_label">输入要添加的位置:</string>
<string name="dialog_add_no_city_found">未找到匹配您输入的位置。建议从下拉列表中选择项目。</string>
<string name="dialog_add_add_button">添加</string>
<string name="error_convert_to_json">获取的天气数据格式不正确。</string>
<string name="error_no_internet">您的设备未连接到互联网</string>
<string name="error_fetch_forecast">更新预报时出错,请重试!</string>
<string name="error_no_city_selected">未选择位置。请前往\"管理位置\"进行选择。</string>
<string name="settings_interval_quarter">15分钟</string>
<string name="settings_interval_half">30分钟</string>
<string name="settings_interval_one">1小时</string>
<string name="settings_interval_two">2小时</string>
<string name="settings_interval_six">6小时</string>
<string name="settings_interval_twelve">12小时</string>
<string name="settings_interval_twentyfour">24小时</string>
<string name="settings_intervals">间隔</string>
<string name="settings_update_interval">更新间隔</string>
<string name="settings_interval_summary">设置自动更新的间隔时间</string>
<string name="about_privacy_answer">太阳能预测仅使用\"互联网\"权限获取天气数据。不包含任何跟踪机制或广告。</string>
<string name="about_where_from">天气信息来自哪里?</string>
<string name="about_where_from_answer">天气信息获取自</string>
<string name="long_press_text">长按并拖动可排序。</string>
<string name="swipe_to_delete">滑动删除</string>
<string name="settings_title_display_options">显示选项</string>
<string name="infoProvider">天气信息获取自Open-Meteo.com</string>
<string name="monday">星期一</string>
<string name="tuesday">星期二</string>
<string name="wednesday">星期三</string>
<string name="thursday">星期四</string>
<string name="friday">星期五</string>
<string name="saturday">星期六</string>
<string name="sunday">星期日</string>
<string name="chart">图表</string>
<string name="units_kWh">千瓦时</string>
<string name="dialog_edit_change_button">保存</string>
<string name="edit_location_hint_name">名称</string>
<string name="settings_search">搜索</string>
<string name="settings_darkmode">Android 10+深色模式</string>
<string name="settings_time24h">24小时制</string>
<string name="summary_time24h">覆盖系统设置</string>
<string name="dialog_OK_button">确定</string>
<string name="dialog_NO_button"></string>
<string name="dialog_Later_button">稍后再说</string>
<string name="dialog_StarOnGitHub">喜欢这个应用吗请在GitHub上给个星标并通过PayPal请开发者喝杯咖啡。</string>
<string name="slide3_heading">Open-Meteo</string>
<string name="settings_forecast_days">预报天数</string>
<string name="edit_location_hint_latitude">纬度[°]</string>
<string name="edit_location_hint_longitude">经度[°]</string>
<string name="edit_location_hint_azimuth">方位角[°]</string>
<string name="edit_location_hint_tilt">倾斜角[°]</string>
<string name="edit_location_hint_cells_max_power">电池峰值功率[W]</string>
<string name="edit_location_hint_cells_efficiency">电池效率[%]</string>
<string name="edit_location_hint_cells_area">电池面积[m²]</string>
<string name="edit_location_hint_diffuse_efficiency">漫射辐射效率[%]</string>
<string name="edit_location_hint_inverter_power_limit">逆变器功率[W]</string>
<string name="edit_location_hint_inverter_efficiency">逆变器效率[%]</string>
<string name="units_Wh">瓦时</string>
<string name="edit_location_title">编辑位置</string>
<string name="edit_location_shading_azimuth_heading">方位角范围[°]</string>
<string name="edit_location_shading_solar_elevation_heading">最小太阳高度角[°]</string>
<string name="edit_location_shading_opacity_heading">此高度以下的遮阳度[%]</string>
<string name="edit_location_shading_heading">遮阳</string>
<string name="activity_help">使用说明</string>
<string name="action_sun_position">当前太阳位置</string>
<string name="action_sun_elevation">高度角[°]</string>
<string name="edit_location_hint_cells_temp_coeff">温度系数[%/K]</string>
<string name="activity_backuprestore">备份/恢复</string>
<string name="backup_database">备份数据库</string>
<string name="restore_database">恢复数据库</string>
<string name="permission_required">需要权限</string>
<string name="permission_message">%s需要访问外部存储。请授予权限后重试。</string>
<string name="toast_delete">请删除文件后重试</string>
<string name="settings_summarize">显示总和</string>
<string name="summary_summarize">汇总相同经纬度模块的值。</string>
<string name="dialog_add_clone_button">克隆</string>
<string name="itemRemoved">已删除:%s</string>
<string name="undo">撤销</string>
<string name="edit_location_hint_albedo">反照率[0..1]</string>
<string name="settings_server_urls">服务器URL</string>
<string name="settings_server_summary">仅在您想托管自己的服务器时更改</string>
<string name="edit_location_hint_central_inverter">中央逆变器</string>
<string name="card_today_heading">今日</string>
<string name="card_today_produced">已发电:</string>
<string name="card_today_remaining">剩余:</string>
</resources>

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorStatusBar">#024265</color>
<color name="colorPrimary">#024265</color>
<color name="colorPrimaryDark">#024265</color>
<color name="colorAccent">#0274b2</color>

View file

@ -1,5 +1,5 @@
<resources>
<string name="app_name">solXpect</string>
<string name="app_name" translatable="false">solXpect</string>
<string name="activity_about">About</string>
<string name="activity_settings">Settings</string>
<string name="activity_weather">Forecast</string>

View file

@ -10,7 +10,6 @@
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
</style>
<style name="SplashTheme" parent="@android:style/Theme.NoTitleBar.Fullscreen">

View file

@ -9,7 +9,7 @@ buildscript {
}
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.1'
classpath 'com.android.tools.build:gradle:8.2.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files

View file

@ -0,0 +1 @@
Update for Android 15 (SDK 35)

View file

@ -1,7 +1,7 @@
#Mon Oct 03 08:25:14 CEST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionSha256Sum=f581709a9c35e9cb92e16f585d2c4bc99b2b1a5f85d2badbd3dc6bff59e1e6dd
distributionSha256Sum=9631d53cf3e74bfa726893aee1f8994fee4e060c401335946dba2156f440f24c
zipStoreBase=GRADLE_USER_HOME