Skip to content

Commit

Permalink
Merge branch 'development' into 'master'
Browse files Browse the repository at this point in the history
Update packageName and sdkVersion

See merge request apphud/android!10
  • Loading branch information
Nikolay Goldin committed Jan 13, 2021
2 parents 9f2cc91 + 7807134 commit 36c0674
Show file tree
Hide file tree
Showing 16 changed files with 58 additions and 27 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ android {
buildToolsVersion "29.0.3"

defaultConfig {
applicationId "com.apphud.mbdg.myapplication"
applicationId "com.apphud.app"
minSdkVersion 16
targetSdkVersion 29
versionCode 18
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.apphud.app.myapplication

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.apphud.app.myapplication", appContext.packageName)
}
}
7 changes: 4 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.apphud.mbdg.myapplication">
package="com.apphud.app">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.android.vending.BILLING" />

<application
android:name="com.apphud.mbdg.myapplication.App"
android:name=".App"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name="com.apphud.mbdg.myapplication.MainActivity">

<activity android:name="com.apphud.app.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.apphud.mbdg.myapplication
package com.apphud.app

import android.app.Application
import com.apphud.sdk.Apphud
Expand Down
8 changes: 8 additions & 0 deletions app/src/main/java/com/apphud/app/Constants.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.apphud.app

object Constants {

const val API_KEY = "app_oBcXz2z9j8spKPL2T7sZwQaQN5Jzme" //my api key
// const val API_KEY = "app_oghnMxjFfAuKogzaGYkBSGJFd6tmwH" //test api key
const val APPSFLYER_DEV_KEY = "AbwD69b6Foj9WT3huU9emh"
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.apphud.mbdg.myapplication
package com.apphud.app

import android.content.Intent
import android.os.Bundle
import android.util.Log
import android.widget.Button
Expand All @@ -12,9 +11,9 @@ import com.apphud.sdk.Apphud
import com.apphud.sdk.ProductId
import com.apphud.sdk.domain.ApphudNonRenewingPurchase
import com.apphud.sdk.domain.ApphudSubscription
import com.apphud.mbdg.myapplication.presentation.ProductModel
import com.apphud.mbdg.myapplication.presentation.ProductModelMapper
import com.apphud.mbdg.myapplication.presentation.ProductsAdapter
import com.apphud.app.presentation.ProductModel
import com.apphud.app.presentation.ProductModelMapper
import com.apphud.app.presentation.ProductsAdapter

class MainActivity : AppCompatActivity() {

Expand Down Expand Up @@ -79,6 +78,5 @@ class MainActivity : AppCompatActivity() {
}
val recyclerView = findViewById<RecyclerView>(R.id.recyclerViewId)
recyclerView.adapter = adapter
startService(Intent(this, MyService::class.java))
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.apphud.mbdg.myapplication
package com.apphud.app

import android.app.Service
import android.content.Intent
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.apphud.mbdg.myapplication.presentation
package com.apphud.app.presentation

import android.annotation.SuppressLint
import android.view.View
import android.widget.Button
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.apphud.app.R
import com.apphud.sdk.buildTime
import com.apphud.mbdg.myapplication.R

class ProductHolder(
val view: View,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.apphud.mbdg.myapplication.presentation
package com.apphud.app.presentation

import com.android.billingclient.api.SkuDetails
import com.apphud.sdk.domain.ApphudNonRenewingPurchase
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.apphud.mbdg.myapplication.presentation
package com.apphud.app.presentation

import com.android.billingclient.api.SkuDetails
import com.apphud.sdk.domain.ApphudNonRenewingPurchase
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.apphud.mbdg.myapplication.presentation
package com.apphud.app.presentation

import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.RecyclerView
import com.apphud.mbdg.myapplication.R
import com.apphud.app.R

fun diff(old: List<ProductModel>, new: List<ProductModel>) = object : DiffUtil.Callback() {
override fun areItemsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean =
Expand Down
5 changes: 0 additions & 5 deletions app/src/main/java/com/apphud/mbdg/myapplication/Constants.kt

This file was deleted.

2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
tools:context="com.apphud.app.MainActivity">

<Button
android:id="@+id/syncButtonViewId"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.apphud.mbdg.myapplication
package com.apphud.app.myapplication

import org.junit.Test

Expand Down
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
kotlin.code.style=official

sdkVersion=0.6
5 changes: 4 additions & 1 deletion sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ android {
defaultConfig {
minSdkVersion 16
targetSdkVersion 29

final name = project.properties.sdkVersion

versionCode 1
versionName "1.0.0"
versionName name

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
Expand Down

0 comments on commit 36c0674

Please sign in to comment.