View TabBarController.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TabBarController : AppCompatActivity() { | |
private val adapter by lazy { TabAdapter(supportFragmentManager) } | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_tab_bar_controller) | |
tab_bar_container.adapter = adapter | |
tab_bar_container.offscreenPageLimit = adapter.count |
View FixedViewPager.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FixedViewPager @JvmOverloads constructor(context: Context, | |
attrs: AttributeSet? = null) : ViewPager(context, attrs) { | |
override fun onTouchEvent(ev: MotionEvent?) = false | |
override fun onInterceptTouchEvent(ev: MotionEvent?) = false | |
} |
View activity_tab_bar_controller.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<android.support.design.widget.BottomNavigationView | |
android:id="@+id/tab_bar" | |
android:layout_width="match_parent" |
View Storyboard.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
enum Storyboard: String { | |
case main | |
var value: String { | |
return self.rawValue.capitalized | |
} | |
} |
View UnderlinedTextField.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
@IBDesignable | |
class UnderlinedTextField: UITextField { | |
@IBInspectable var borderColor: UIColor = Colors.darkText { | |
didSet { setNeedsDisplay() } | |
} | |
@IBInspectable var borderedWidth: CGFloat = 1 { |
View CAReplicatorLayer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RepeatingCircle: UIView { | |
let replicatorLayer = CAReplicatorLayer() | |
let circle = CALayer() | |
let duration: TimeInterval = 1.0 | |
let circleSize: CGFloat = 15 | |
let instanceCount = 20 | |
override func draw(_ rect: CGRect) { |
NewerOlder