Modifying the available apps to be the real one and

a promo that is useful to promote Burguillos.info to
advertisers.
This commit is contained in:
Sergiotarxz 2023-09-02 06:08:35 +02:00
parent 414c27fd86
commit 6fea21cf42
8 changed files with 28 additions and 7 deletions

View File

@ -18,15 +18,15 @@ android {
applicationId = "info.burguillos.bi"
minSdk = 26
targetSdk = 33
versionCode = 1
versionName = "1.0"
versionCode = 4
versionName = "4.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
isMinifyEnabled = false
isMinifyEnabled = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
@ -38,6 +38,19 @@ android {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
flavorDimensions += "destination"
productFlavors {
create("promo") {
manifestPlaceholders["host"] = "promo.burguillos.info"
applicationIdSuffix = ".promo";
versionNameSuffix = "-promo"
}
create("real") {
manifestPlaceholders["host"] = "burguillos.info"
versionNameSuffix = "-real"
}
}
}
dependencies {

View File

@ -34,7 +34,7 @@
<data android:scheme="https"/>
<data android:scheme="http"/>
<data android:host="burguillos.info"/>
<data android:host="${host}"/>
</intent-filter>
</activity-alias>
</application>

View File

@ -57,7 +57,7 @@ public class MainActivity extends AppCompatActivity {
private WebView webView;
private SwipeRefreshLayout swipeRefreshLayout;
private RelativeLayout relativeLayout;
String baseUrl = "https://burguillos.info";
String baseUrl;
String hrefContextMenu = null;
String srcContextMenu = null;
@ -116,8 +116,8 @@ public class MainActivity extends AppCompatActivity {
final int id = item.getItemId();
ClipData clip = null;
ClipboardManager clipboard = (ClipboardManager) getSystemService(this.CLIPBOARD_SERVICE);
Intent targetIntent = null;
Uri targetUri = null;
Intent targetIntent = null;
Uri targetUri = null;
switch (id) {
case MenuId.OPEN_LINK:
targetUri = Uri.parse(hrefContextMenu);
@ -170,6 +170,7 @@ public class MainActivity extends AppCompatActivity {
public void onCreateContextMenu (ContextMenu menu,
View v,
ContextMenu.ContextMenuInfo menuinfo) {
Log.w("BurguillosInfo", baseUrl);
new MenuInflater(MainActivity.this).inflate(R.menu.long_click_webview, menu);
if (hrefContextMenu != null) {
menu.add(Menu.NONE, MenuId.OPEN_LINK, Menu.NONE, "Abrir enlace.");
@ -188,6 +189,7 @@ public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
baseUrl = getResources().getString(R.string.baseUrl);
setContentView(R.layout.activity_main);

View File

@ -0,0 +1,3 @@
<resources>
<string name="baseUrl">https://promo.burguillos.info</string>
</resources>

View File

@ -0,0 +1,3 @@
<resources>
<string name="baseUrl">https://burguillos.info</string>
</resources>