Skip to content

Commit

Permalink
Merge pull request #12 from icanerdogan/appdevelopment
Browse files Browse the repository at this point in the history
1.0.0
  • Loading branch information
icanerdogan authored Jul 21, 2023
2 parents 45f979a + 266ee1e commit 3185fc2
Show file tree
Hide file tree
Showing 121 changed files with 2,417 additions and 98 deletions.
8 changes: 4 additions & 4 deletions .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 13 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ plugins {
id 'kotlin-kapt'
}

def versionMajor = 1
def versionMinor = 0
def versionPatch = 0

android {
namespace 'com.ibrahimcanerdogan.valorantguideapp'
compileSdk 33
Expand All @@ -13,8 +17,8 @@ android {
applicationId "com.ibrahimcanerdogan.valorantguideapp"
minSdk 24
targetSdk 33
versionCode 1
versionName "1.0"
versionCode versionMajor * 1000 + versionMinor * 100 + versionPatch * 10
versionName "${versionMajor}.${versionMinor}.${versionPatch}"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down Expand Up @@ -119,9 +123,16 @@ dependencies {
implementation "com.github.bumptech.glide:glide:$glide_version"
annotationProcessor "com.github.bumptech.glide:compiler:$glide_version"

// Expandable Layout
def expandable_version = "2.9.2"
implementation "com.github.cachapa:ExpandableLayout:$expandable_version"

// Swipe Refresh
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"

// Splash
implementation 'androidx.core:core-splashscreen:1.0.0-beta02'

// Test
// Core library
androidTestImplementation('androidx.test:core:1.5.0')
Expand Down
9 changes: 5 additions & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,21 @@

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<application
android:name=".App"
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:icon="@mipmap/ic_launcher_light"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:roundIcon="@mipmap/ic_launcher_light_round"
android:supportsRtl="true"
android:theme="@style/Theme.ValorantGuideApp"
android:theme="@style/Theme.ValorantGuideApp.Splash"
tools:targetApi="31">
<activity
android:name=".view.MainActivity"
android:theme="@style/Theme.ValorantGuideApp.Splash"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
Binary file added app/src/main/ic_launcher_dark-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/ic_launcher_light-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ import com.ibrahimcanerdogan.valorantguideapp.data.model.agent.AgentVoiceLine
import com.ibrahimcanerdogan.valorantguideapp.data.model.map.MapCallout
import com.ibrahimcanerdogan.valorantguideapp.data.model.map.MapData
import com.ibrahimcanerdogan.valorantguideapp.data.model.map.MapLocation
import com.ibrahimcanerdogan.valorantguideapp.data.model.weapon.WeaponData
import com.ibrahimcanerdogan.valorantguideapp.data.model.weapon.shop.WeaponShop
import com.ibrahimcanerdogan.valorantguideapp.data.model.weapon.skin.SkinChroma
import com.ibrahimcanerdogan.valorantguideapp.data.model.weapon.skin.SkinLevel
import com.ibrahimcanerdogan.valorantguideapp.data.model.weapon.skin.WeaponSkin
import com.ibrahimcanerdogan.valorantguideapp.data.model.weapon.stats.StatAds
import com.ibrahimcanerdogan.valorantguideapp.data.model.weapon.stats.StatAirBurst
import com.ibrahimcanerdogan.valorantguideapp.data.model.weapon.stats.StatAltShotgun
import com.ibrahimcanerdogan.valorantguideapp.data.model.weapon.stats.StatDamageRange
import com.ibrahimcanerdogan.valorantguideapp.data.model.weapon.stats.WeaponStat

class Converters {
private val gson = Gson()
Expand Down Expand Up @@ -137,4 +147,108 @@ class Converters {
val type = object : TypeToken<MapLocation>() {}.type
return gson.fromJson(json, type)
}

// WEAPON

@TypeConverter
fun fromWeaponData(weaponData: WeaponData): String {
return gson.toJson(weaponData)
}

@TypeConverter
fun toWeaponData(json: String): WeaponData {
return gson.fromJson(json, WeaponData::class.java)
}

@TypeConverter
fun fromWeaponStat(weaponStat: WeaponStat?): String {
return gson.toJson(weaponStat)
}

@TypeConverter
fun toWeaponStat(json: String): WeaponStat? {
return gson.fromJson(json, WeaponStat::class.java)
}

@TypeConverter
fun fromStatAds(statAds: StatAds): String {
return gson.toJson(statAds)
}

@TypeConverter
fun toStatAds(json: String): StatAds {
return gson.fromJson(json, StatAds::class.java)
}

@TypeConverter
fun fromStatAltShotgun(statAltShotgun: StatAltShotgun): String {
return gson.toJson(statAltShotgun)
}

@TypeConverter
fun toStatAltShotgun(json: String): StatAltShotgun {
return gson.fromJson(json, StatAltShotgun::class.java)
}

@TypeConverter
fun fromStatAirBurst(statAirBurst: StatAirBurst): String {
return gson.toJson(statAirBurst)
}

@TypeConverter
fun toStatAirBurst(json: String): StatAirBurst {
return gson.fromJson(json, StatAirBurst::class.java)
}

@TypeConverter
fun fromStatDamageRange(statDamageRange: StatDamageRange): String {
return gson.toJson(statDamageRange)
}

@TypeConverter
fun toStatDamageRange(json: String): StatDamageRange {
return gson.fromJson(json, StatDamageRange::class.java)
}

@TypeConverter
fun fromWeaponSkinList(weaponSkins: List<WeaponSkin>?): String? {
return gson.toJson(weaponSkins)
}

@TypeConverter
fun toWeaponSkinList(json: String?): List<WeaponSkin>? {
val type = object : TypeToken<List<WeaponSkin>>() {}.type
return gson.fromJson(json, type)
}

@TypeConverter
fun fromSkinChroma(skinChroma: SkinChroma): String {
return gson.toJson(skinChroma)
}

@TypeConverter
fun toSkinChroma(json: String): SkinChroma {
return gson.fromJson(json, SkinChroma::class.java)
}

@TypeConverter
fun fromSkinLevel(skinLevel: SkinLevel): String {
return gson.toJson(skinLevel)
}

@TypeConverter
fun toSkinLevel(json: String): SkinLevel {
return gson.fromJson(json, SkinLevel::class.java)
}


@TypeConverter
fun fromWeaponShop(weaponShop: WeaponShop?): String {
return gson.toJson(weaponShop)
}

@TypeConverter
fun toWeaponShop(json: String): WeaponShop? {
return gson.fromJson(json, WeaponShop::class.java)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,21 @@ import androidx.room.RoomDatabase
import androidx.room.TypeConverters
import com.ibrahimcanerdogan.valorantguideapp.data.database.agent.AgentDao
import com.ibrahimcanerdogan.valorantguideapp.data.database.map.MapDao
import com.ibrahimcanerdogan.valorantguideapp.data.database.weapon.WeaponDao
import com.ibrahimcanerdogan.valorantguideapp.data.model.agent.AgentData
import com.ibrahimcanerdogan.valorantguideapp.data.model.map.MapData
import com.ibrahimcanerdogan.valorantguideapp.data.model.weapon.WeaponData

@Database(
entities = [AgentData::class, MapData::class],
version = 3,
entities = [AgentData::class, MapData::class, WeaponData::class],
version = 7,
exportSchema = false
)
@TypeConverters(Converters::class)
abstract class ValorantDatabase : RoomDatabase(){
abstract fun agentDao() : AgentDao

abstract fun mapDao() : MapDao

abstract fun weaponDao() : WeaponDao
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.ibrahimcanerdogan.valorantguideapp.data.database.weapon

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import com.ibrahimcanerdogan.valorantguideapp.data.model.weapon.WeaponData

@Dao
interface WeaponDao {

@Insert(onConflict = OnConflictStrategy.REPLACE)
suspend fun saveWeaponDatabase(agentList: List<WeaponData>)

@Query("SELECT * FROM weapon_data")
fun getWeaponListDatabase(): List<WeaponData>
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ data class MapData(
@SerializedName("displayName")
val mapDisplayName: String,
@SerializedName("coordinates")
val mapCoordinates: String,
val mapCoordinates: String?,
@SerializedName("displayIcon")
val mapDisplayIcon: String?,
@SerializedName("listViewIcon")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.ibrahimcanerdogan.valorantguideapp.data.model.weapon

import com.google.gson.annotations.SerializedName

data class Weapon(
@SerializedName("status")
val status: Int,
@SerializedName("data")
val weapons: List<WeaponData>
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.ibrahimcanerdogan.valorantguideapp.data.model.weapon

import androidx.room.Entity
import androidx.room.PrimaryKey
import com.google.gson.annotations.SerializedName
import com.ibrahimcanerdogan.valorantguideapp.data.model.weapon.shop.WeaponShop
import com.ibrahimcanerdogan.valorantguideapp.data.model.weapon.skin.WeaponSkin
import com.ibrahimcanerdogan.valorantguideapp.data.model.weapon.stats.WeaponStat

@Entity(
tableName = "weapon_data"
)
data class WeaponData(
@PrimaryKey
@SerializedName("uuid")
val uuid: String,
@SerializedName("displayName")
val weaponDisplayName: String, // Vandal
@SerializedName("category")
val weaponCategory: String, // EEquippableCategory::Rifle
@SerializedName("defaultSkinUuid")
val weaponDefaultSkinUuid: String,
@SerializedName("displayIcon")
val weaponDisplayIcon: String, // : https://media.valorant-api.com/weapons/9c82e19d-4575-0200-1a81-3eacf00cf872/displayicon.png
@SerializedName("killStreamIcon")
val weaponKillStreamIcon: String,
@SerializedName("weaponStats")
val weaponStats: WeaponStat?, // Weapon Damage & Other Stats
@SerializedName("shopData")
val weaponShop: WeaponShop?,
@SerializedName("skins")
val weaponSkins: List<WeaponSkin>
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.ibrahimcanerdogan.valorantguideapp.data.model.weapon.shop

import androidx.room.PrimaryKey
import com.google.gson.annotations.SerializedName

data class WeaponShop(
@PrimaryKey(autoGenerate = true)
val shopId : Int,
@SerializedName("cost")
val shopCost: Int, // 2900
@SerializedName("category")
val shopCategory: String, // Rifles
@SerializedName("categoryText")
val shopCategoryText: String, // Assault Rifles
@SerializedName("image")
val shopImage: String?,
@SerializedName("newImage")
val shopNewImage: String?,
@SerializedName("newImage2")
val shopNewImage2: String?
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.ibrahimcanerdogan.valorantguideapp.data.model.weapon.skin

import androidx.room.PrimaryKey
import com.google.gson.annotations.SerializedName

data class SkinChroma(
@PrimaryKey
@SerializedName("uuid")
val uuid: String,
@SerializedName("displayName")
val chromaDisplayName: String, // Araxys Bulldog Level 4\n(Variant 1 Purple)
@SerializedName("displayIcon")
val chromaDisplayIcon: String?, // null or same full render
@SerializedName("fullRender")
val chromaFullRender: String, // https://media.valorant-api.com/weaponskinchromas/49451aa7-4a30-3d0e-2cf9-a19afc966041/fullrender.png
@SerializedName("swatch")
val chromaSwatch: String?,
@SerializedName("streamedVideo")
val chromaStreamedVideo: String?
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.ibrahimcanerdogan.valorantguideapp.data.model.weapon.skin

import androidx.room.PrimaryKey
import com.google.gson.annotations.SerializedName

data class SkinLevel(
@PrimaryKey
@SerializedName("uuid")
val uuid: String,
@SerializedName("displayName")
val levelDisplayName: String,
@SerializedName("levelItem")
val levelItem: String?,
@SerializedName("displayIcon")
val levelDisplayIcon: String?,
@SerializedName("streamedVideo")
val levelStreamedVideo: String?,
)
Loading

0 comments on commit 3185fc2

Please sign in to comment.