diff --git a/app/build.gradle b/app/build.gradle index e6aa6d3..7baf9e3 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -16,9 +16,31 @@ android { testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } + flavorDimensions 'price' + + productFlavors{ + free{ + dimension "price" + resValue "string", "app_name", "Chrono Master Free" + applicationIdSuffix ".free" + versionNameSuffix "-free" + } + paid{ + applicationId "com.equipo22.agenda.paid" + dimension "price" + resValue "string", "app_name", "Chrono Master Paid" + versionNameSuffix "-full" + } + } + buildTypes { + debug{ + applicationIdSuffix ".debug" + debuggable true + } release { - minifyEnabled false + minifyEnabled true + shrinkResources true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } diff --git a/app/src/free/java/com/equipo22/agenda/AdsFragment.kt b/app/src/free/java/com/equipo22/agenda/AdsFragment.kt new file mode 100644 index 0000000..68c91d5 --- /dev/null +++ b/app/src/free/java/com/equipo22/agenda/AdsFragment.kt @@ -0,0 +1,74 @@ +package com.equipo22.agenda + +import android.graphics.drawable.AnimationDrawable +import android.os.Bundle +import android.os.Handler +import android.os.Looper +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.ImageView +import android.widget.LinearLayout +import android.widget.Toast +import androidx.core.content.res.ResourcesCompat +import androidx.core.view.isVisible +import androidx.fragment.app.Fragment +import com.google.android.material.button.MaterialButton +import com.google.android.material.dialog.MaterialAlertDialogBuilder + + +class AdsFragment : Fragment() { + + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + val view = inflater.inflate(R.layout.fragment_ads, container, false) + + val btnPaid = view.findViewById(R.id.btnPaid) + val LinearAds = view.findViewById(R.id.LinearAds) + + + loop() + + + btnPaid.setOnClickListener { + + MaterialAlertDialogBuilder(requireActivity()) + .setTitle(resources.getString(R.string.compra_dialog_title)) + .setMessage( + resources.getString( + R.string.compra_dialog + ) + ) + .setPositiveButton(resources.getString(R.string.accept)) { dialog, which -> + Toast.makeText(requireActivity(),getString(R.string.paidOut), Toast.LENGTH_SHORT).show() + LinearAds.visibility=View.GONE + } + .setNegativeButton(resources.getString(R.string.btnCancel)) { dialog, which -> + } + .show() + + } + return view + } + + fun loop(){ + Handler(Looper.getMainLooper()).postDelayed({ + anuncios((0..2).random()) + loop() + }, 3000) + } + fun anuncios(n:Int){ + val imageAds = view?.findViewById(R.id.imageAds) + when(n){ + 0->imageAds?.setImageResource(R.drawable.ads_becas) + 1 ->imageAds?.setImageResource(R.drawable.ads_mexico) + 2 -> imageAds?.setImageResource(R.drawable.ads_sale) + else ->imageAds?.setImageResource(R.drawable.ads_becas) + } + } + + +} \ No newline at end of file diff --git a/app/src/free/res/layout/fragment_ads.xml b/app/src/free/res/layout/fragment_ads.xml new file mode 100644 index 0000000..ca8cf1f --- /dev/null +++ b/app/src/free/res/layout/fragment_ads.xml @@ -0,0 +1,25 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/free/res/values/strings.xml b/app/src/free/res/values/strings.xml new file mode 100644 index 0000000..8254f57 --- /dev/null +++ b/app/src/free/res/values/strings.xml @@ -0,0 +1,6 @@ + + Quitar anuncios + Eliminar anuncios + ¿Está seguro que desea comprar la version premium por $10? + Gracias por su compra + \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index ed3f173..07e791c 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -7,7 +7,7 @@ android:allowBackup="true" android:fullBackupContent="true" android:icon="@mipmap/ic_launcher" - android:label="@string/appName" + android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/ChronoMasterTheme"> diff --git a/app/src/main/res/drawable/ads_becas.jpg b/app/src/main/res/drawable/ads_becas.jpg new file mode 100644 index 0000000..0c1380b Binary files /dev/null and b/app/src/main/res/drawable/ads_becas.jpg differ diff --git a/app/src/main/res/drawable/ads_mexico.jpg b/app/src/main/res/drawable/ads_mexico.jpg new file mode 100644 index 0000000..8310382 Binary files /dev/null and b/app/src/main/res/drawable/ads_mexico.jpg differ diff --git a/app/src/main/res/drawable/ads_sale.jpg b/app/src/main/res/drawable/ads_sale.jpg new file mode 100644 index 0000000..8747a6f Binary files /dev/null and b/app/src/main/res/drawable/ads_sale.jpg differ diff --git a/app/src/main/res/layout/activity_tarea_management.xml b/app/src/main/res/layout/activity_tarea_management.xml index eb24511..4c07c86 100644 --- a/app/src/main/res/layout/activity_tarea_management.xml +++ b/app/src/main/res/layout/activity_tarea_management.xml @@ -1,6 +1,24 @@ - + xmlns:android="http://schemas.android.com/apk/res/android" > + + + + + + diff --git a/app/src/main/res/layout/fragment_ads.xml b/app/src/main/res/layout/fragment_ads.xml new file mode 100644 index 0000000..541368d --- /dev/null +++ b/app/src/main/res/layout/fragment_ads.xml @@ -0,0 +1,10 @@ + + + + + diff --git a/app/src/main/res/layout/fragment_agregar_tarea.xml b/app/src/main/res/layout/fragment_agregar_tarea.xml index a47e71b..c8e1b56 100644 --- a/app/src/main/res/layout/fragment_agregar_tarea.xml +++ b/app/src/main/res/layout/fragment_agregar_tarea.xml @@ -197,6 +197,7 @@ android:id="@+id/btnCancel" style="@style/ChronoMasterTheme.Button" android:text="@string/btnCancel" - app:cornerRadius="20dp" /> + app:cornerRadius="20dp" + android:layout_marginBottom="100dp"/> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_editar_tarea.xml b/app/src/main/res/layout/fragment_editar_tarea.xml index a47e71b..d8f551c 100644 --- a/app/src/main/res/layout/fragment_editar_tarea.xml +++ b/app/src/main/res/layout/fragment_editar_tarea.xml @@ -197,6 +197,8 @@ android:id="@+id/btnCancel" style="@style/ChronoMasterTheme.Button" android:text="@string/btnCancel" - app:cornerRadius="20dp" /> + app:cornerRadius="20dp" + android:layout_marginBottom="100dp" + /> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_ver_listado.xml b/app/src/main/res/layout/fragment_ver_listado.xml index 5a4a5cd..d9c1a5d 100644 --- a/app/src/main/res/layout/fragment_ver_listado.xml +++ b/app/src/main/res/layout/fragment_ver_listado.xml @@ -50,7 +50,8 @@ app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/nameUser" - app:layout_constraintVertical_bias="0.344"> + app:layout_constraintVertical_bias="0.344" + android:layout_marginBottom="100dp"> - Chrono Master Log In Sign Up Usuario diff --git a/app/src/paid/java/com/equipo22/agenda/AdsFragment.kt b/app/src/paid/java/com/equipo22/agenda/AdsFragment.kt new file mode 100644 index 0000000..098e22d --- /dev/null +++ b/app/src/paid/java/com/equipo22/agenda/AdsFragment.kt @@ -0,0 +1,26 @@ +package com.equipo22.agenda + +import android.os.Bundle +import android.util.Log +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.ImageView +import android.widget.LinearLayout +import android.widget.Toast +import androidx.fragment.app.Fragment +import com.google.android.material.button.MaterialButton + + + +class AdsFragment : Fragment() { + + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + return inflater.inflate(R.layout.fragment_ads, container, false) + + } +} \ No newline at end of file diff --git a/app/src/paid/res/layout/fragment_ads.xml b/app/src/paid/res/layout/fragment_ads.xml new file mode 100644 index 0000000..dd7097d --- /dev/null +++ b/app/src/paid/res/layout/fragment_ads.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/app/src/paid/res/values/strings.xml b/app/src/paid/res/values/strings.xml new file mode 100644 index 0000000..954afba --- /dev/null +++ b/app/src/paid/res/values/strings.xml @@ -0,0 +1,4 @@ + + Quitar anuncios + Gracias por su compra + \ No newline at end of file