Skip to content

Commit

Permalink
💥 BREAKING CHANGE: Rename project to "Phocam"
Browse files Browse the repository at this point in the history
  • Loading branch information
Seidko committed Nov 29, 2022
1 parent d025a50 commit 7bf75af
Show file tree
Hide file tree
Showing 19 changed files with 61 additions and 62 deletions.
25 changes: 13 additions & 12 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ plugins {
}

android {
namespace 'com.seidko.phomic'
namespace 'com.seidko.phocam'
compileSdk 32

defaultConfig {
applicationId "com.seidko.phomic"
applicationId "com.seidko.phocam"
minSdk 26
//noinspection OldTargetApi
targetSdk 32
versionCode 1
versionName "1.0"
Expand Down Expand Up @@ -37,15 +38,15 @@ android {

dependencies {

implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1'
implementation 'androidx.navigation:navigation-fragment-ktx:2.4.1'
implementation 'androidx.navigation:navigation-ui-ktx:2.4.1'
implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.android.material:material:1.7.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.5.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1'
implementation 'androidx.navigation:navigation-fragment-ktx:2.5.3'
implementation 'androidx.navigation:navigation-ui-ktx:2.5.3'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.4'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.seidko.phomic
package com.seidko.phocam

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
Expand All @@ -19,6 +19,6 @@ class ExampleInstrumentedTest {
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.seidko.phomic", appContext.packageName)
assertEquals("com.seidko.phocam", appContext.packageName)
}
}
7 changes: 3 additions & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Phomic"
android:theme="@style/Theme.Phocam"
tools:targetApi="31"
android:name=".data.PhomicApplication"
android:name=".data.PhocamApplication"
>
<activity
android:name=".MainActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/Theme.Phomic.NoActionBar">
android:theme="@style/Theme.Phocam.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.seidko.phomic
package com.seidko.phocam


import android.os.Bundle
Expand All @@ -12,18 +12,18 @@ import androidx.navigation.ui.setupActionBarWithNavController
import androidx.navigation.ui.setupWithNavController
import androidx.drawerlayout.widget.DrawerLayout
import androidx.appcompat.app.AppCompatActivity
import com.seidko.phomic.data.PhomicApplication
import com.seidko.phomic.databinding.ActivityMainBinding
import com.seidko.phocam.data.PhocamApplication
import com.seidko.phocam.databinding.ActivityMainBinding

class MainActivity : AppCompatActivity() {

private lateinit var appBarConfiguration: AppBarConfiguration
private lateinit var binding: ActivityMainBinding
private lateinit var app: PhomicApplication
private lateinit var app: PhocamApplication

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
app = application as PhomicApplication
app = application as PhocamApplication

binding = ActivityMainBinding.inflate(layoutInflater)
setContentView(binding.root)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.seidko.phomic.base.adapter
package com.seidko.phocam.base.adapter

import android.content.Context
import android.view.LayoutInflater
Expand All @@ -7,9 +7,9 @@ import android.view.ViewGroup
import android.widget.ImageView
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.seidko.phomic.R
import com.seidko.phomic.data.entities.Connection
import com.seidko.phomic.data.entities.ConnectionStatus
import com.seidko.phocam.R
import com.seidko.phocam.data.entities.Connection
import com.seidko.phocam.data.entities.ConnectionStatus


class ConnectionRecyclerAdapter(private var connectionArray: ArrayList<Connection>) :
Expand Down
7 changes: 7 additions & 0 deletions app/src/main/java/com/seidko/phocam/data/PhocamApplication.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.seidko.phocam.data

import android.app.Application

class PhocamApplication: Application() {
var running = false
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.seidko.phomic.data.entities
package com.seidko.phocam.data.entities

/**
* Connection data entity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.seidko.phomic.ui.home
package com.seidko.phocam.ui.home

import android.os.Bundle
import android.view.LayoutInflater
Expand All @@ -7,14 +7,14 @@ import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.lifecycle.ViewModelProvider
import androidx.recyclerview.widget.LinearLayoutManager
import com.seidko.phomic.base.adapter.ConnectionRecyclerAdapter
import com.seidko.phomic.data.entities.Connection
import com.seidko.phomic.data.entities.ConnectionType
import com.seidko.phomic.databinding.FragmentPhomicBinding
import com.seidko.phocam.base.adapter.ConnectionRecyclerAdapter
import com.seidko.phocam.data.entities.Connection
import com.seidko.phocam.data.entities.ConnectionType
import com.seidko.phocam.databinding.FragmentPhocamBinding

class HomeFragment : Fragment() {

private var _binding: FragmentPhomicBinding? = null
private var _binding: FragmentPhocamBinding? = null

// This property is only valid between onCreateView and
// onDestroyView.
Expand All @@ -29,7 +29,7 @@ class HomeFragment : Fragment() {
@Suppress("UNUSED_VARIABLE")
val homeViewModel = ViewModelProvider(this)[HomeViewModel::class.java]

_binding = FragmentPhomicBinding.inflate(inflater, container, false)
_binding = FragmentPhocamBinding.inflate(inflater, container, false)
val root: View = binding.root
val connectionRecyclerView = binding.connectionRecyclerView
val layoutManager = LinearLayoutManager(this.context)
Expand All @@ -41,7 +41,6 @@ class HomeFragment : Fragment() {
connectionRecyclerView.adapter = ConnectionRecyclerAdapter(connectionList)
connectionRecyclerView.layoutManager = layoutManager


return root
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.seidko.phomic.ui.home
package com.seidko.phocam.ui.home

import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
Expand Down
7 changes: 0 additions & 7 deletions app/src/main/java/com/seidko/phomic/data/PhomicApplication.kt

This file was deleted.

4 changes: 2 additions & 2 deletions app/src/main/res/layout/app_bar_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/Theme.Phomic.AppBarOverlay">
android:theme="@style/Theme.Phocam.AppBarOverlay">

<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/Theme.Phomic.PopupOverlay" />
app:popupTheme="@style/Theme.Phocam.PopupOverlay" />

</com.google.android.material.appbar.AppBarLayout>

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion app/src/main/res/layout/item_connection.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/Theme.Phomic.ListItem"
android:theme="@style/Theme.Phocam.ListItem"
android:background="@drawable/bg_shape"
android:layout_marginTop="8dp">

Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/navigation/mobile_navigation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<fragment
android:id="@+id/nav_home"
android:name="com.seidko.phomic.ui.home.HomeFragment"
android:name="com.seidko.phocam.ui.home.HomeFragment"
android:label="@string/menu_home"
tools:layout="@layout/fragment_phomic" />
tools:layout="@layout/fragment_phocam" />
</navigation>
8 changes: 4 additions & 4 deletions app/src/main/res/values-night/themes.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<resources>
<!-- Base application theme. -->
<style name="Theme.Phomic" parent="Theme.MaterialComponents.DayNight">
<style name="Theme.Phocam" parent="Theme.MaterialComponents.DayNight">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/gray_700</item>
<item name="colorOnPrimary">@color/white</item>
Expand All @@ -14,19 +14,19 @@
<item name="backgroundColor">@color/gray_700</item>
</style>

<style name="Theme.Phomic.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
<style name="Theme.Phocam.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
<item name="android:textColorPrimary">@color/white</item>
</style>

<!-- 标记一个坑: Menu的字体颜色修改在这里-->
<style name="Theme.Phomic.PopupOverlay" parent="ThemeOverlay.AppCompat.Dark" >
<style name="Theme.Phocam.PopupOverlay" parent="ThemeOverlay.AppCompat.Dark" >
<!-- ActionBar上的title的字体颜色 -->
<item name="titleTextColor">?attr/colorOnPrimary</item>
<!-- ActionBar上Menu的字体颜色 -->
<item name="actionMenuTextColor">?attr/colorOnPrimary</item>
</style>

<style name="Theme.Phomic.ListItem">
<style name="Theme.Phocam.ListItem">
<item name="android:textColor">@color/white</item>
</style>
</resources>
4 changes: 2 additions & 2 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<resources>
<string name="app_name" translatable="false">Phomic</string>
<string name="app_name" translatable="false">Phocam</string>
<string name="navigation_drawer_open" translatable="false">Open navigation drawer</string>
<string name="navigation_drawer_close" translatable="false">Close navigation drawer</string>
<string name="nav_header_title" translatable="false">Phomic</string>
<string name="nav_header_title" translatable="false">Phocam</string>
<string name="nav_header_subtitle" translatable="false">[email protected]</string>
<string name="nav_header_desc" translatable="false">Navigation header</string>
<string name="action_settings">Settings</string>
Expand Down
10 changes: 5 additions & 5 deletions app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<resources>
<!-- Base application theme. -->
<style name="Theme.Phomic" parent="Theme.MaterialComponents.DayNight">
<style name="Theme.Phocam" parent="Theme.MaterialComponents.DayNight">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/gray_300</item>
<item name="colorPrimaryVariant">@color/gray_300</item>
Expand All @@ -16,18 +16,18 @@
<item name="backgroundColor">@color/gray_200</item>
</style>

<style name="Theme.Phomic.NoActionBar">
<style name="Theme.Phocam.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>

<style name="Theme.Phomic.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
<style name="Theme.Phocam.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
<item name="android:textColorPrimary">@color/black</item>
</style>

<style name="Theme.Phomic.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
<style name="Theme.Phocam.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />

<style name="Theme.Phomic.ListItem">
<style name="Theme.Phocam.ListItem">
<item name="android:textColor">@color/black</item>
</style>
</resources>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.seidko.phomic
package com.seidko.phocam

import org.junit.Test

Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ dependencyResolutionManagement {
mavenCentral()
}
}
rootProject.name = "Phomic"
rootProject.name = "Phocam"
include ':app'

0 comments on commit 7bf75af

Please sign in to comment.