Skip to content

Commit

Permalink
Merge pull request #14 from odaridavid/code-style
Browse files Browse the repository at this point in the history
apply consistent code style
  • Loading branch information
odaridavid authored May 11, 2020
2 parents 5ccb3d5 + 2126ec3 commit 972f9dc
Show file tree
Hide file tree
Showing 32 changed files with 33 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import com.github.odaridavid.designpatterns.helpers.SdkUtils.versionFrom
import com.github.odaridavid.designpatterns.helpers.SdkUtils.versionUntil
import com.github.odaridavid.designpatterns.helpers.ThemeUtils

abstract class BaseActivity : AppCompatActivity(), ISystemThemeChangeListener<Any> {
internal abstract class BaseActivity : AppCompatActivity(), ISystemThemeChangeListener<Any> {

private val powerManager: PowerManager by lazy {
getSystemService(Context.POWER_SERVICE) as PowerManager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const val BASE_PATH = "file:///android_asset"
const val LIGHT_KOTLIN_CSS_PATH = "$BASE_PATH/kotlin.css"
const val DARK_KOTLIN_CSS_PATH = "$BASE_PATH/dark_kotlin.css"

object CodeSample {
internal object CodeSample {
const val ABSTRACT_FACTORY = "$BASE_PATH/abstract_factory.md"
const val ADAPTER = "$BASE_PATH/adapter.md"
const val BRIDGE = "$BASE_PATH/bridge.md"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import com.github.odaridavid.designpatterns.helpers.SdkUtils.versionUntil
import us.feras.mdv.MarkdownView


inline fun <reified T> Activity.navigateTo(noinline intentExtras: ((Intent) -> Unit)? = null) {
internal inline fun <reified T> Activity.navigateTo(noinline intentExtras: ((Intent) -> Unit)? = null) {
val intent = Intent(this, T::class.java)
intentExtras?.run {
intentExtras(intent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
package com.github.odaridavid.designpatterns.helpers


object NavigationUtils {
internal object NavigationUtils {
const val KEY_DESIGN_PATTERN = "design_pattern"
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ import com.github.odaridavid.designpatterns.helpers.CodeSample
import kotlinx.android.parcel.Parcelize

@Parcelize
data class DesignPattern(
internal data class DesignPattern(
@StringRes val name: Int,
@StringRes val description: Int,
val codeSample: String
) : Parcelable

fun generateDesignPatterns(): List<DesignPattern> {
internal fun generateDesignPatterns(): List<DesignPattern> {
return listOf(
DesignPattern(
R.string.title_adapter,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import com.github.odaridavid.designpatterns.helpers.checkUrlScheme
import com.mikepenz.aboutlibraries.Libs
import jp.wasabeef.recyclerview.adapters.ScaleInAnimationAdapter

class AboutActivity : BaseActivity() {
internal class AboutActivity : BaseActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import com.github.odaridavid.designpatterns.helpers.NavigationUtils
import com.github.odaridavid.designpatterns.helpers.loadWithKotlinCss
import com.github.odaridavid.designpatterns.models.DesignPattern

class DesignPatternDetailActivity : BaseActivity() {
internal class DesignPatternDetailActivity : BaseActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import com.github.odaridavid.designpatterns.databinding.ItemDesignPatternBinding
import com.github.odaridavid.designpatterns.models.DesignPattern


class DesignPatternsAdapter(val onClick: (DesignPattern) -> Unit) :
internal class DesignPatternsAdapter(val onClick: (DesignPattern) -> Unit) :
ListAdapter<DesignPattern, DesignPatternsAdapter.DesignPatternViewHolder>(DiffUtil) {

override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): DesignPatternViewHolder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import android.view.View
import androidx.recyclerview.widget.RecyclerView


class GridSpaceItemDecoration(var spaceInPx: Int) : RecyclerView.ItemDecoration() {
internal class GridSpaceItemDecoration(var spaceInPx: Int) : RecyclerView.ItemDecoration() {

override fun getItemOffsets(
outRect: Rect,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import com.github.odaridavid.designpatterns.databinding.ItemLibraryBinding
import com.mikepenz.aboutlibraries.entity.Library


class LibrariesAdapter(val onClick: (String) -> Unit) :
internal class LibrariesAdapter(val onClick: (String) -> Unit) :
ListAdapter<Library, LibrariesAdapter.LicenseViewHolder>(DiffUtil) {

override fun onBindViewHolder(holder: LicenseViewHolder, position: Int) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import com.github.odaridavid.designpatterns.models.generateDesignPatterns
import com.google.android.play.core.install.model.ActivityResult
import jp.wasabeef.recyclerview.adapters.ScaleInAnimationAdapter

class MainActivity : BaseActivity() {
internal class MainActivity : BaseActivity() {

private lateinit var binding: ActivityMainBinding

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import com.github.odaridavid.designpatterns.patterns.adapter.StockCableAdapter
import org.junit.Test


class AdapterPatternUnitTest {
internal class AdapterPatternUnitTest {

@Test
fun onConnectedToPowerPort_withStockCableAdapter_printsStatus() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import com.github.odaridavid.designpatterns.patterns.bridge.VintageFurniture
import org.junit.Test


class BridgePatternUnitTest {
internal class BridgePatternUnitTest {

@Test
fun getType_fromFurniture_returnWithFurnitureTheme() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import com.github.odaridavid.designpatterns.patterns.builder.Scene
import com.github.odaridavid.designpatterns.patterns.builder.TimeOfDay
import org.junit.Test

class BuilderPatternUnitTest {
internal class BuilderPatternUnitTest {

@Test
fun build_returnGameEnvironment() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import com.github.odaridavid.designpatterns.patterns.chainofresponsibility.IceCr
import com.github.odaridavid.designpatterns.patterns.chainofresponsibility.IceCreamVendor
import org.junit.Test

class ChainOfResponsibilityPatternUnitTest {
internal class ChainOfResponsibilityPatternUnitTest {

@Test
fun icecreamOrderRequest_chainOfResponsibility() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import com.github.odaridavid.designpatterns.patterns.command.RaceOrganizer
import org.junit.Test


class CommandPatternUnitTest {
internal class CommandPatternUnitTest {

@Test
fun raceEvent_commandPattern() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import com.github.odaridavid.designpatterns.patterns.composite.MagarineContainer
import org.junit.Test


class CompositePatternUnitTest {
internal class CompositePatternUnitTest {

@Test
fun containers_compositePattern() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import com.github.odaridavid.designpatterns.patterns.decorator.SportsBar
import org.junit.Test


class DecoratorPatternUnitTest {
internal class DecoratorPatternUnitTest {

@Test
fun barDecoration_decoratorPattern() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package com.github.odaridavid.designpatterns
import com.github.odaridavid.designpatterns.patterns.facade.AnimationDirector
import org.junit.Test

class FacadePatternUnitTest {
internal class FacadePatternUnitTest {

@Test
fun performAnimations_facadePattern() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import com.github.odaridavid.designpatterns.patterns.factory.ParkBench
import com.github.odaridavid.designpatterns.patterns.factory.Sofa
import org.junit.Test

class FactoryPatternUnitTest {
internal class FactoryPatternUnitTest {

@Test
fun getChair_chairFactoy_FactoryPattern() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import com.github.odaridavid.designpatterns.patterns.flyweight.GameSceneFactory
import com.github.odaridavid.designpatterns.patterns.flyweight.TimeOfDay
import org.junit.Test

class FlyweightPatternUnitTest {
internal class FlyweightPatternUnitTest {

@Test
fun gameScenes_flyweightPattern() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ package com.github.odaridavid.designpatterns
import com.github.odaridavid.designpatterns.patterns.iterator.CarShowroom
import org.junit.Test

class IteratorPatternUnitTest {
internal class IteratorPatternUnitTest {
@Test
fun carShowroom_iteratorPattern() {
CarShowroom().showcaseCars()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import com.github.odaridavid.designpatterns.patterns.mediator.User
import org.junit.Test


class MediatorPatternUnitTest {
internal class MediatorPatternUnitTest {

@Test
fun parcel_mediatorPattern() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import com.github.odaridavid.designpatterns.patterns.memento.Originator
import org.junit.Test


class MementoPatternUnitTest {
internal class MementoPatternUnitTest {

@Test
fun savingStates_mementoPattern() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import com.github.odaridavid.designpatterns.patterns.observer.NewsletterPublishe
import com.github.odaridavid.designpatterns.patterns.observer.Reader
import org.junit.Test

class ObserverPatternUnitTest {
internal class ObserverPatternUnitTest {

@Test
fun newsletterSubscription_observerPattern() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import com.github.odaridavid.designpatterns.patterns.prototype.Configs
import org.junit.Test


class PrototypePatternUnitTest {
internal class PrototypePatternUnitTest {

@Test
fun configs_copy() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import com.github.odaridavid.designpatterns.patterns.proxy.ProxyCar
import org.junit.Test


class ProxyPatternUnitTest {
internal class ProxyPatternUnitTest {

@Test
fun driveProxyCar_ProxyPattern() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import com.github.odaridavid.designpatterns.patterns.singleton.CentralBank
import org.junit.Test


class SingletonPatternUnitTest {
internal class SingletonPatternUnitTest {

@Test
fun centralBankGetMoney_isSameInstance_singletonPattern() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import com.github.odaridavid.designpatterns.patterns.state.Door
import org.junit.Test


class StatePatternUnitTest {
internal class StatePatternUnitTest {

@Test
fun door_statePattern() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import com.github.odaridavid.designpatterns.patterns.strategy.OrderTransaction
import org.junit.Test


class StrategyPatternUnitTest {
internal class StrategyPatternUnitTest {

@Test
fun billing_strategyPattern() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import com.github.odaridavid.designpatterns.patterns.templatemethod.RectangularW
import org.junit.Test


class TemplateMethodUnitTest {
internal class TemplateMethodUnitTest {

@Test
fun window_templateMethod() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import com.github.odaridavid.designpatterns.patterns.visitor.Lodging
import org.junit.Test


class VisitorPatternUnitTest {
internal class VisitorPatternUnitTest {

@Test
fun accommodation_visitorPattern() {
Expand Down

0 comments on commit 972f9dc

Please sign in to comment.