mirror of
https://github.com/f-droid/fdroidclient.git
synced 2026-06-19 13:20:01 -04:00
get "basic" flavor building and running
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Senecto Limited
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 3
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
package org.fdroid.fdroid.localrepo.peers;
|
||||
|
||||
import org.fdroid.fdroid.data.NewRepoConfig;
|
||||
|
||||
/**
|
||||
* Dummy version for basic app flavor.
|
||||
*/
|
||||
public class WifiPeer {
|
||||
public WifiPeer(NewRepoConfig config) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Senecto Limited
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 3
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
package org.fdroid.fdroid.net;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.support.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Dummy version for basic app flavor.
|
||||
*/
|
||||
public class WifiStateChangeService {
|
||||
public static void start(Context context, @Nullable Intent intent) {
|
||||
}
|
||||
|
||||
public class WifiInfoThread extends Thread {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Senecto Limited
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 3
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
package org.fdroid.fdroid.net.bluetooth;
|
||||
|
||||
/**
|
||||
* Dummy version for basic app flavor.
|
||||
*/
|
||||
|
||||
public class BluetoothClient {
|
||||
|
||||
public BluetoothClient(String ignored) {
|
||||
}
|
||||
|
||||
public BluetoothConnection openConnection() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Senecto Limited
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 3
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
package org.fdroid.fdroid.views.hiding;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
/**
|
||||
* Dummy version for basic app flavor.
|
||||
*/
|
||||
public class HidingManager {
|
||||
|
||||
public static boolean isHidden(Context context) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Senecto Limited
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 3
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
package org.fdroid.fdroid.views.main;
|
||||
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.widget.FrameLayout;
|
||||
import org.fdroid.fdroid.R;
|
||||
import org.fdroid.fdroid.views.fragments.PreferencesFragment;
|
||||
import org.fdroid.fdroid.views.updates.UpdatesViewBinder;
|
||||
|
||||
/**
|
||||
* Decides which view on the main screen to attach to a given {@link FrameLayout}. This class
|
||||
* doesn't know which view it will be rendering at the time it is constructed. Rather, at some
|
||||
* point in the future the {@link MainViewAdapter} will have information about which view we
|
||||
* are required to render, and will invoke the relevant "bind*()" method on this class.
|
||||
*/
|
||||
class MainViewController extends RecyclerView.ViewHolder {
|
||||
|
||||
private final AppCompatActivity activity;
|
||||
private final FrameLayout frame;
|
||||
|
||||
@Nullable
|
||||
private UpdatesViewBinder updatesView = null;
|
||||
|
||||
MainViewController(AppCompatActivity activity, FrameLayout frame) {
|
||||
super(frame);
|
||||
this.activity = activity;
|
||||
this.frame = frame;
|
||||
}
|
||||
|
||||
public void bindWhatsNewView() {
|
||||
throw new IllegalStateException("unimplemented");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see UpdatesViewBinder
|
||||
*/
|
||||
public void bindUpdates() {
|
||||
if (updatesView == null) {
|
||||
updatesView = new UpdatesViewBinder(activity, frame);
|
||||
}
|
||||
|
||||
updatesView.bind();
|
||||
}
|
||||
|
||||
public void unbindUpdates() {
|
||||
if (updatesView != null) {
|
||||
updatesView.unbind();
|
||||
}
|
||||
}
|
||||
|
||||
public void bindCategoriesView() {
|
||||
throw new IllegalStateException("unimplemented");
|
||||
}
|
||||
|
||||
public void bindSwapView() {
|
||||
throw new IllegalStateException("unimplemented");
|
||||
}
|
||||
|
||||
/**
|
||||
* Attaches a {@link PreferencesFragment} to the view. Everything else is managed by the
|
||||
* fragment itself, so no further work needs to be done by this view binder.
|
||||
* <p>
|
||||
* Note: It is tricky to attach a {@link Fragment} to a view from this view holder. This is due
|
||||
* to the way in which the {@link RecyclerView} will reuse existing views and ask us to
|
||||
* put a settings fragment in there at arbitrary times. Usually it wont be the same view we
|
||||
* attached the fragment to last time, which causes weirdness. The solution is to use code from
|
||||
* the com.lsjwzh.widget.recyclerviewpager.FragmentStatePagerAdapter which manages this.
|
||||
* The code has been ported to {@link SettingsView}.
|
||||
*
|
||||
* @see SettingsView
|
||||
*/
|
||||
public void bindSettingsView() {
|
||||
activity.getLayoutInflater().inflate(R.layout.main_tab_settings, frame, true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Senecto Limited
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 3
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
package org.fdroid.fdroid.views.swap;
|
||||
|
||||
/**
|
||||
* Dummy version for basic app flavor.
|
||||
*/
|
||||
public class SwapWorkflowActivity {
|
||||
public static final String EXTRA_PREVENT_FURTHER_SWAP_REQUESTS = "preventFurtherSwap";
|
||||
public static final String EXTRA_CONFIRM = "EXTRA_CONFIRM";
|
||||
}
|
||||
14
app/src/basic/res/menu/main_activity_screens.xml
Normal file
14
app/src/basic/res/menu/main_activity_screens.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<item
|
||||
android:title="@string/updates"
|
||||
android:icon="@drawable/ic_updates"
|
||||
app:showAsAction="ifRoom|withText"
|
||||
android:id="@+id/updates" />
|
||||
<item
|
||||
android:title="@string/menu_settings"
|
||||
android:icon="@drawable/ic_settings"
|
||||
app:showAsAction="ifRoom|withText"
|
||||
android:id="@+id/settings" />
|
||||
</menu>
|
||||
163
app/src/basic/res/xml/preferences.xml
Normal file
163
app/src/basic/res/xml/preferences.xml
Normal file
@@ -0,0 +1,163 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.v7.preference.PreferenceScreen
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<android.support.v7.preference.PreferenceScreen android:title="@string/about_title">
|
||||
<intent
|
||||
android:action="android.intent.action.MAIN"
|
||||
android:targetPackage="@string/applicationId"
|
||||
android:targetClass="org.fdroid.fdroid.AboutActivity"/>
|
||||
</android.support.v7.preference.PreferenceScreen>
|
||||
|
||||
<android.support.v7.preference.PreferenceCategory android:title="@string/preference_category__my_apps">
|
||||
<android.support.v7.preference.PreferenceScreen android:title="@string/preference_manage_installed_apps">
|
||||
<intent
|
||||
android:action="android.intent.action.MAIN"
|
||||
android:targetPackage="@string/applicationId"
|
||||
android:targetClass="org.fdroid.fdroid.views.installed.InstalledAppsActivity"/>
|
||||
</android.support.v7.preference.PreferenceScreen>
|
||||
<android.support.v7.preference.PreferenceScreen
|
||||
android:title="@string/menu_manage"
|
||||
android:summary="@string/repositories_summary">
|
||||
<intent
|
||||
android:action="android.intent.action.MAIN"
|
||||
android:targetPackage="@string/applicationId"
|
||||
android:targetClass="org.fdroid.fdroid.views.ManageReposActivity"/>
|
||||
</android.support.v7.preference.PreferenceScreen>
|
||||
</android.support.v7.preference.PreferenceCategory>
|
||||
|
||||
<android.support.v7.preference.PreferenceCategory android:title="@string/updates">
|
||||
<org.fdroid.fdroid.views.LiveSeekBarPreference
|
||||
android:key="overWifi"
|
||||
android:title="@string/over_wifi"
|
||||
android:layout="@layout/preference_seekbar"/>
|
||||
<org.fdroid.fdroid.views.LiveSeekBarPreference
|
||||
android:key="overData"
|
||||
android:title="@string/over_data"
|
||||
android:layout="@layout/preference_seekbar"/>
|
||||
<SwitchPreference
|
||||
android:title="@string/update_auto_download"
|
||||
android:summary="@string/update_auto_download_summary"
|
||||
android:defaultValue="false"
|
||||
android:key="updateAutoDownload"/>
|
||||
<org.fdroid.fdroid.views.LiveSeekBarPreference
|
||||
android:key="updateIntervalSeekBarPosition"
|
||||
android:title="@string/update_interval"
|
||||
android:layout="@layout/preference_seekbar"/>
|
||||
<SwitchPreference
|
||||
android:title="@string/notify"
|
||||
android:defaultValue="true"
|
||||
android:key="updateNotify"/>
|
||||
</android.support.v7.preference.PreferenceCategory>
|
||||
|
||||
<android.support.v7.preference.PreferenceCategory android:title="@string/display"
|
||||
android:key="pref_category_display">
|
||||
<ListPreference
|
||||
android:title="@string/pref_language"
|
||||
android:key="language"/>
|
||||
<ListPreference
|
||||
android:title="@string/theme"
|
||||
android:key="theme"
|
||||
android:defaultValue="light"
|
||||
android:entries="@array/themeNames"
|
||||
android:entryValues="@array/themeValues"/>
|
||||
</android.support.v7.preference.PreferenceCategory>
|
||||
|
||||
<android.support.v7.preference.PreferenceCategory android:title="@string/appcompatibility">
|
||||
<SwitchPreference
|
||||
android:title="@string/show_incompat_versions"
|
||||
android:defaultValue="false"
|
||||
android:key="incompatibleVersions"/>
|
||||
<SwitchPreference
|
||||
android:title="@string/show_root_apps"
|
||||
android:defaultValue="true"
|
||||
android:key="rooted"/>
|
||||
<SwitchPreference
|
||||
android:title="@string/show_anti_feature_apps"
|
||||
android:defaultValue="false"
|
||||
android:key="showAntiFeatureApps"/>
|
||||
<SwitchPreference
|
||||
android:title="@string/force_touch_apps"
|
||||
android:defaultValue="false"
|
||||
android:key="ignoreTouchscreen"/>
|
||||
</android.support.v7.preference.PreferenceCategory>
|
||||
|
||||
<android.support.v7.preference.PreferenceCategory android:title="@string/proxy">
|
||||
<SwitchPreference
|
||||
android:key="useTor"
|
||||
android:summary="@string/useTorSummary"
|
||||
android:title="@string/useTor"/>
|
||||
<SwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:key="enableProxy"
|
||||
android:title="@string/enable_proxy_title"
|
||||
android:summary="@string/enable_proxy_summary"/>
|
||||
<EditTextPreference
|
||||
android:key="proxyHost"
|
||||
android:title="@string/proxy_host"
|
||||
android:summary="@string/proxy_host_summary"
|
||||
android:dependency="enableProxy"/>
|
||||
<EditTextPreference
|
||||
android:key="proxyPort"
|
||||
android:title="@string/proxy_port"
|
||||
android:summary="@string/proxy_port_summary"
|
||||
android:dependency="enableProxy"/>
|
||||
</android.support.v7.preference.PreferenceCategory>
|
||||
|
||||
<android.support.v7.preference.PreferenceCategory
|
||||
android:key="pref_category_privacy"
|
||||
android:title="@string/privacy">
|
||||
|
||||
<SwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:key="preventScreenshots"
|
||||
android:summary="@string/preventScreenshots_summary"
|
||||
android:title="@string/preventScreenshots_title"/>
|
||||
|
||||
</android.support.v7.preference.PreferenceCategory>
|
||||
|
||||
<android.support.v7.preference.PreferenceCategory
|
||||
android:title="@string/other"
|
||||
android:key="pref_category_other">
|
||||
<ListPreference
|
||||
android:title="@string/cache_downloaded"
|
||||
android:key="keepCacheFor"
|
||||
android:defaultValue="86400000"
|
||||
android:entries="@array/keepCacheNames"
|
||||
android:entryValues="@array/keepCacheValues"/>
|
||||
<SwitchPreference
|
||||
android:title="@string/expert"
|
||||
android:defaultValue="false"
|
||||
android:key="expert"/>
|
||||
<CheckBoxPreference
|
||||
android:key="unstableUpdates"
|
||||
android:title="@string/unstable_updates"
|
||||
android:summary="@string/unstable_updates_summary"
|
||||
android:defaultValue="false"
|
||||
android:dependency="expert"/>
|
||||
<CheckBoxPreference
|
||||
android:key="keepInstallHistory"
|
||||
android:title="@string/keep_install_history"
|
||||
android:summary="@string/keep_install_history_summary"
|
||||
android:defaultValue="false"
|
||||
android:dependency="expert"/>
|
||||
<CheckBoxPreference
|
||||
android:key="forceOldIndex"
|
||||
android:title="@string/force_old_index"
|
||||
android:summary="@string/force_old_index_summary"
|
||||
android:defaultValue="false"
|
||||
android:dependency="expert"/>
|
||||
<CheckBoxPreference
|
||||
android:title="@string/system_installer"
|
||||
android:defaultValue="false"
|
||||
android:key="privilegedInstaller"
|
||||
android:persistent="false"
|
||||
android:dependency="expert"/>
|
||||
<Preference
|
||||
android:title="@string/uninstall_system"
|
||||
android:summary="@string/uninstall_system_summary"
|
||||
android:key="uninstallPrivilegedApp"
|
||||
android:dependency="expert"/>
|
||||
</android.support.v7.preference.PreferenceCategory>
|
||||
|
||||
</android.support.v7.preference.PreferenceScreen>
|
||||
Reference in New Issue
Block a user