This file contains hidden or 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 LandingPageController extends GetxController { | |
var tabIndex = 0.obs; | |
void changeTabIndex(int index) { | |
tabIndex.value = index; | |
} | |
@override | |
void onInit() { | |
super.onInit(); |
This file contains hidden or 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 LandingPage extends StatelessWidget { | |
final TextStyle unselectedLabelStyle = TextStyle( | |
color: Colors.white.withOpacity(0.5), | |
fontWeight: FontWeight.w500, | |
fontSize: 12); | |
final TextStyle selectedLabelStyle = | |
TextStyle(color: Colors.white, fontWeight: FontWeight.w500, fontSize: 12); | |
buildBottomNavigationMenu(context, landingPageController) { |
This file contains hidden or 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 'dart:typed_data'; | |
import 'dart:ui' hide Image; | |
import 'package:image/image.dart' as img_lib; | |
import 'dart:math' as math; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/rendering.dart'; | |
enum ImageFetchState { initial, fetching, fetched } | |
class ImagePlayground extends StatefulWidget { |
This file contains hidden or 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 NewClubAdapter() : ListAdapter<ClubEntity, ClubViewHolder>(AddClubsDiffUtils()) { | |
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ClubViewHolder { | |
return ClubViewHolder.from(parent) | |
} | |
override fun onBindViewHolder(holder: ClubViewHolder, position: Int) { | |
holder.bind(getItem(position)) | |
} |
This file contains hidden or 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
fun newStaticLayout( | |
source: CharSequence, | |
paint: TextPaint, | |
width: Int, | |
alignment: Layout.Alignment, | |
spacingmult: Float, | |
spacingadd: Float, | |
includepad: Boolean | |
): StaticLayout { | |
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { |
This file contains hidden or 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
/** | |
* A [RecyclerView.ItemDecoration] which draws sticky headers marking the league in a given list of | |
* [Block]s. | |
*/ | |
class ClubHeadersDecoration( | |
context: Context, | |
blocks: List<ClubEntity> | |
) : ItemDecoration() { | |
private val paint: TextPaint |
This file contains hidden or 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
val newClubAdapter = NewClubAdapter(mViewModel) | |
dataBinding.recyclerView.adapter = newClubAdapter | |
newClubAdapter.submitList(data) | |
dataBinding.recyclerView.clearDecorations() | |
if (data.isNotEmpty()) { | |
dataBinding.recyclerView.addItemDecoration( | |
ClubHeadersDecoration(dataBinding.recyclerView.context, data) | |
) | |
} |
This file contains hidden or 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
/** | |
* Find the first league of each set and return pairs of | |
* index to league name. Assumes that clubs are sorted by ascending league name. | |
*/ | |
fun indexAgendaHeaders(agendaItems: List<ClubEntity>): List<Pair<Int, String>> { | |
return agendaItems | |
.mapIndexed { index, block -> index to block.clubLeague } | |
.distinctBy { it.second } | |
} |
This file contains hidden or 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
//@version=3 | |
// | |
// Pivot Points High Low Extension | |
// | |
// See Also: | |
// - A Simple 1-2-3 Method for Trading Forex <http://webinar.tradingpub.com/resources/lp/tpub_topshelf/Top_Shelf_Magazine/forex/A_Simple_1_2_3_Method_for_Trading_Forex.php> | |
// - The Classic 1-2-3 Pattern: An Underestimated Powerhouse <https://www.tradeciety.com/the-classic-1-2-3-pattern-underestimated-powerhouse/> | |
// - Bulkowski's 1-2-3 Trend Change <http://thepatternsite.com/123tc.html> | |
// | |
// |
This file contains hidden or 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
// @version=3 | |
// | |
// Pivot Points indicator, calculated in the "traditional" way, also called "floor-trader pivots". | |
// | |
// Additionally, and optional to the user, the halves between the key levels are also shown. | |
// | |
// The Default chosen Time Frame to calculate the pivot points is: | |
// Daily (D) if within intraday | |
// Weekly (W) if within daily chart | |
// Monthly (M) if within weekly chart |
NewerOlder