Skip to content

Commit

Permalink
Refactor: Rename package name from space.tarn to dev.arkbuilders
Browse files Browse the repository at this point in the history
  • Loading branch information
tuancoltech committed Nov 6, 2023
1 parent 50558c5 commit 8fc978b
Show file tree
Hide file tree
Showing 27 changed files with 81 additions and 85 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ android {
compileSdk 33

defaultConfig {
applicationId "space.taran.arkmemo"
applicationId "dev.arkbuilders.arkmemo"
minSdk 26
targetSdk 33
versionCode 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package space.taran.arkmemo
package dev.arkbuilders.arkmemo

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("space.taran.arkmemo", appContext.packageName)
assertEquals("dev.arkbuilders.arkmemo", appContext.packageName)
}
}
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="space.taran.arkmemo">
package="dev.arkbuilders.arkmemo">

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package space.taran.arkmemo
package dev.arkbuilders.arkmemo

import android.app.Application
import android.content.Context
import dagger.hilt.android.HiltAndroidApp
import dev.arkbuilders.arklib.initArkLib
import kotlinx.coroutines.CoroutineScope
Expand All @@ -13,7 +12,7 @@ import org.acra.data.StringFormat
import org.acra.ktx.initAcra
import org.acra.sender.HttpSender
import dev.arkbuilders.arkfilepicker.folders.FoldersRepo
import space.taran.arkmemo.space.taran.arkmemo.utils.Config
import dev.arkbuilders.arkmemo.utils.Config

@HiltAndroidApp
class App: Application() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package space.taran.arkmemo.contracts
package dev.arkbuilders.arkmemo.contracts

import android.app.Activity
import android.content.Context
import android.content.Intent
import android.net.Uri
Expand All @@ -9,7 +8,6 @@ import android.os.Environment
import android.provider.Settings
import androidx.activity.result.contract.ActivityResultContract
import androidx.annotation.RequiresApi
import space.taran.arkmemo.files.FilePicker

class PermissionContract: ActivityResultContract<String, Boolean>() {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package space.taran.arkmemo.data
package dev.arkbuilders.arkmemo.data

import dev.arkbuilders.arklib.ResourceId
import java.nio.file.attribute.FileTime
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package space.taran.arkmemo.data.repositories
package dev.arkbuilders.arkmemo.data.repositories

import kotlinx.coroutines.CoroutineScope
import space.taran.arkmemo.models.TextNote
import dev.arkbuilders.arkmemo.models.TextNote
import java.nio.file.Path

interface TextNotesRepo {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package space.taran.arkmemo.data.repositories
package dev.arkbuilders.arkmemo.data.repositories

import android.util.Log
import dev.arkbuilders.arklib.ResourceId
Expand All @@ -10,8 +10,8 @@ import dev.arkbuilders.arklib.user.properties.PropertiesStorageRepo
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import space.taran.arkmemo.data.ResourceMeta
import space.taran.arkmemo.models.TextNote
import dev.arkbuilders.arkmemo.data.ResourceMeta
import dev.arkbuilders.arkmemo.models.TextNote
import java.nio.file.Files
import java.nio.file.Path
import javax.inject.Inject
Expand Down Expand Up @@ -69,7 +69,7 @@ class TextNotesRepoImpl @Inject constructor(): TextNotesRepo {
size
)
val titles = propertiesStorage.getProperties(id).titles
val content = TextNote.Content(titles.elementAt(0), data.toString())
val content = TextNote.Content(titles.elementAtOrNull(0) ?: "", data.toString())
val note = TextNote(content, meta)
notes.add(note)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package space.taran.arkmemo.di
package dev.arkbuilders.arkmemo.di

import dagger.Binds
import dagger.Module
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import space.taran.arkmemo.preferences.MemoPreferences
import space.taran.arkmemo.preferences.MemoPreferencesImpl
import dev.arkbuilders.arkmemo.preferences.MemoPreferences
import dev.arkbuilders.arkmemo.preferences.MemoPreferencesImpl

@InstallIn(SingletonComponent::class)
@Module
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package space.taran.arkmemo.di
package dev.arkbuilders.arkmemo.di

import dagger.Binds
import dagger.Module
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import space.taran.arkmemo.data.repositories.TextNotesRepo
import space.taran.arkmemo.data.repositories.TextNotesRepoImpl
import dev.arkbuilders.arkmemo.data.repositories.TextNotesRepo
import dev.arkbuilders.arkmemo.data.repositories.TextNotesRepoImpl


@InstallIn(SingletonComponent::class)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package space.taran.arkmemo.files
package dev.arkbuilders.arkmemo.files

import android.Manifest
import android.content.Context
Expand All @@ -13,8 +13,8 @@ import androidx.fragment.app.FragmentManager
import dev.arkbuilders.arkfilepicker.ArkFilePickerConfig
import dev.arkbuilders.arkfilepicker.presentation.filepicker.ArkFilePickerFragment
import dev.arkbuilders.arkfilepicker.presentation.filepicker.ArkFilePickerMode
import space.taran.arkmemo.BuildConfig
import space.taran.arkmemo.R
import dev.arkbuilders.arkmemo.BuildConfig
import dev.arkbuilders.arkmemo.R

class FilePicker private constructor(){
companion object{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package space.taran.arkmemo.files.parsers
package dev.arkbuilders.arkmemo.files.parsers

import android.graphics.Path
import com.google.gson.Gson
import space.taran.arkmemo.models.TextNote
import dev.arkbuilders.arkmemo.models.TextNote

class JsonParser {
companion object{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package space.taran.arkmemo.models
package dev.arkbuilders.arkmemo.models

import android.os.Parcelable
import kotlinx.parcelize.IgnoredOnParcel
import space.taran.arkmemo.data.ResourceMeta
import dev.arkbuilders.arkmemo.data.ResourceMeta
import kotlinx.parcelize.Parcelize

@Parcelize
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package space.taran.arkmemo.preferences
package dev.arkbuilders.arkmemo.preferences

import java.nio.file.Path

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package space.taran.arkmemo.preferences
package dev.arkbuilders.arkmemo.preferences

import android.content.Context
import android.content.Context.MODE_PRIVATE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package space.taran.arkmemo.ui.activities
package dev.arkbuilders.arkmemo.ui.activities

import android.content.ClipboardManager
import android.content.Context
Expand All @@ -15,14 +15,14 @@ import androidx.fragment.app.Fragment
import by.kirich1409.viewbindingdelegate.viewBinding
import dagger.hilt.android.AndroidEntryPoint
import dev.arkbuilders.arkfilepicker.presentation.onArkPathPicked
import space.taran.arkmemo.R
import space.taran.arkmemo.contracts.PermissionContract
import space.taran.arkmemo.databinding.ActivityMainBinding
import space.taran.arkmemo.files.FilePicker
import space.taran.arkmemo.preferences.MemoPreferences
import space.taran.arkmemo.ui.fragments.EditTextNotesFragment
import space.taran.arkmemo.ui.fragments.SettingsFragment
import space.taran.arkmemo.ui.fragments.TextNotesFragment
import dev.arkbuilders.arkmemo.R
import dev.arkbuilders.arkmemo.contracts.PermissionContract
import dev.arkbuilders.arkmemo.databinding.ActivityMainBinding
import dev.arkbuilders.arkmemo.files.FilePicker
import dev.arkbuilders.arkmemo.preferences.MemoPreferences
import dev.arkbuilders.arkmemo.ui.fragments.EditTextNotesFragment
import dev.arkbuilders.arkmemo.ui.fragments.SettingsFragment
import dev.arkbuilders.arkmemo.ui.fragments.TextNotesFragment
import javax.inject.Inject

@AndroidEntryPoint
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package space.taran.arkmemo.ui.adapters
package dev.arkbuilders.arkmemo.ui.adapters

import android.view.LayoutInflater
import android.view.View
Expand All @@ -7,13 +7,13 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.FragmentManager
import androidx.recyclerview.widget.RecyclerView
import by.kirich1409.viewbindingdelegate.viewBinding
import space.taran.arkmemo.R
import space.taran.arkmemo.databinding.TextNoteBinding
import space.taran.arkmemo.models.TextNote
import space.taran.arkmemo.ui.activities.MainActivity
import space.taran.arkmemo.ui.activities.replaceFragment
import space.taran.arkmemo.ui.dialogs.NoteDeleteDialogFragment
import space.taran.arkmemo.ui.fragments.EditTextNotesFragment
import dev.arkbuilders.arkmemo.R
import dev.arkbuilders.arkmemo.databinding.TextNoteBinding
import dev.arkbuilders.arkmemo.models.TextNote
import dev.arkbuilders.arkmemo.ui.activities.MainActivity
import dev.arkbuilders.arkmemo.ui.activities.replaceFragment
import dev.arkbuilders.arkmemo.ui.dialogs.NoteDeleteDialogFragment
import dev.arkbuilders.arkmemo.ui.fragments.EditTextNotesFragment

class TextNotesListAdapter(private val notes: List<TextNote>): RecyclerView.Adapter<TextNotesListAdapter.NoteViewHolder>() {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package space.taran.arkmemo.ui.dialogs
package dev.arkbuilders.arkmemo.ui.dialogs

import android.app.Dialog
import android.os.Bundle
import android.widget.Toast
import androidx.appcompat.app.AlertDialog
import androidx.fragment.app.DialogFragment
import space.taran.arkmemo.R
import space.taran.arkmemo.models.TextNote
import space.taran.arkmemo.ui.fragments.deleteNote
import dev.arkbuilders.arkmemo.R
import dev.arkbuilders.arkmemo.models.TextNote
import dev.arkbuilders.arkmemo.ui.fragments.deleteNote

class NoteDeleteDialogFragment: DialogFragment() {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package space.taran.arkmemo.ui.fragments
package dev.arkbuilders.arkmemo.ui.fragments

import android.os.Bundle
import android.text.Editable
Expand All @@ -9,11 +9,11 @@ import androidx.fragment.app.Fragment
import androidx.fragment.app.activityViewModels
import by.kirich1409.viewbindingdelegate.viewBinding
import dagger.hilt.android.AndroidEntryPoint
import space.taran.arkmemo.R
import space.taran.arkmemo.ui.viewmodels.NotesViewModel
import space.taran.arkmemo.databinding.FragmentEditTextNotesBinding
import space.taran.arkmemo.models.TextNote
import space.taran.arkmemo.ui.activities.MainActivity
import dev.arkbuilders.arkmemo.R
import dev.arkbuilders.arkmemo.ui.viewmodels.NotesViewModel
import dev.arkbuilders.arkmemo.databinding.FragmentEditTextNotesBinding
import dev.arkbuilders.arkmemo.models.TextNote
import dev.arkbuilders.arkmemo.ui.activities.MainActivity

@AndroidEntryPoint
class EditTextNotesFragment: Fragment(R.layout.fragment_edit_text_notes) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package space.taran.arkmemo.ui.fragments
package dev.arkbuilders.arkmemo.ui.fragments

import android.os.Bundle
import android.view.View
Expand All @@ -15,14 +15,14 @@ import by.kirich1409.viewbindingdelegate.viewBinding
import com.google.android.material.floatingactionbutton.FloatingActionButton
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.launch
import space.taran.arkmemo.R
import space.taran.arkmemo.ui.viewmodels.NotesViewModel
import space.taran.arkmemo.databinding.FragmentTextNotesBinding
import space.taran.arkmemo.models.TextNote
import space.taran.arkmemo.ui.activities.MainActivity
import space.taran.arkmemo.ui.activities.getTextFromClipBoard
import space.taran.arkmemo.ui.activities.replaceFragment
import space.taran.arkmemo.ui.adapters.TextNotesListAdapter
import dev.arkbuilders.arkmemo.R
import dev.arkbuilders.arkmemo.ui.viewmodels.NotesViewModel
import dev.arkbuilders.arkmemo.databinding.FragmentTextNotesBinding
import dev.arkbuilders.arkmemo.models.TextNote
import dev.arkbuilders.arkmemo.ui.activities.MainActivity
import dev.arkbuilders.arkmemo.ui.activities.getTextFromClipBoard
import dev.arkbuilders.arkmemo.ui.activities.replaceFragment
import dev.arkbuilders.arkmemo.ui.adapters.TextNotesListAdapter

@AndroidEntryPoint
class TextNotesFragment: Fragment(R.layout.fragment_text_notes) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package space.taran.arkmemo.ui.fragments
package dev.arkbuilders.arkmemo.ui.fragments

import android.os.Bundle
import android.view.View
import androidx.preference.PreferenceFragmentCompat
import dagger.hilt.android.AndroidEntryPoint
import dev.arkbuilders.arkfilepicker.presentation.onArkPathPicked
import space.taran.arkmemo.R
import space.taran.arkmemo.files.FilePicker
import space.taran.arkmemo.preferences.MemoPreferences
import space.taran.arkmemo.ui.activities.MainActivity
import space.taran.arkmemo.ui.views.PathPreference
import dev.arkbuilders.arkmemo.R
import dev.arkbuilders.arkmemo.files.FilePicker
import dev.arkbuilders.arkmemo.preferences.MemoPreferences
import dev.arkbuilders.arkmemo.ui.activities.MainActivity
import dev.arkbuilders.arkmemo.ui.views.PathPreference
import javax.inject.Inject


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package space.taran.arkmemo.ui.viewmodels
package dev.arkbuilders.arkmemo.ui.viewmodels

import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
Expand All @@ -7,9 +7,9 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import space.taran.arkmemo.data.repositories.TextNotesRepo
import space.taran.arkmemo.models.TextNote
import space.taran.arkmemo.preferences.MemoPreferences
import dev.arkbuilders.arkmemo.data.repositories.TextNotesRepo
import dev.arkbuilders.arkmemo.models.TextNote
import dev.arkbuilders.arkmemo.preferences.MemoPreferences
import javax.inject.Inject

@HiltViewModel
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package space.taran.arkmemo.ui.views
package dev.arkbuilders.arkmemo.ui.views

import android.content.Context
import android.util.AttributeSet
import android.widget.TextView
import androidx.preference.Preference
import androidx.preference.PreferenceViewHolder
import space.taran.arkmemo.R
import dev.arkbuilders.arkmemo.R

class PathPreference(context: Context, attrs: AttributeSet): Preference(context, attrs) {
private var title: TextView? = null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package space.taran.arkmemo.space.taran.arkmemo.utils
package dev.arkbuilders.arkmemo.utils

import android.content.Context
import com.simplemobiletools.commons.helpers.BaseConfig
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package space.taran.arkmemo.space.taran.arkmemo.utils
package dev.arkbuilders.arkmemo.utils

// shared preferences
const val CRASH_REPORT_ENABLE = "crash_report_enable"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/xml/root_preferences.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto">
<PreferenceCategory app:title="@string/your_notes">
<space.taran.arkmemo.ui.views.PathPreference
<dev.arkbuilders.arkmemo.ui.views.PathPreference
app:key="@string/path_pref_key"
app:layout="@layout/path_pref" />
</PreferenceCategory>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package space.taran.arkmemo
package dev.arkbuilders.arkmemo

import org.junit.Test

Expand Down

0 comments on commit 8fc978b

Please sign in to comment.