Skip to content

Instantly share code, notes, and snippets.

View AravinthVelusamy's full-sized avatar
🎯
Focusing

Aravinth Velusamy AravinthVelusamy

🎯
Focusing
View GitHub Profile
class LandingPageController extends GetxController {
var tabIndex = 0.obs;
void changeTabIndex(int index) {
tabIndex.value = index;
}
@override
void onInit() {
super.onInit();
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) {
@AravinthVelusamy
AravinthVelusamy / distortion.dart
Created March 18, 2021 03:39 — forked from wilsonowilson/distortion.dart
Widget warping and distortion in Flutter
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 {
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))
}
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) {
/**
* 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
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)
)
}
/**
* 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 }
}
//@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>
//
//
@AravinthVelusamy
AravinthVelusamy / Pivot Points, by @juanmirocks.js
Created January 22, 2020 16:22 — forked from juanmirocks/Pivot Points, by @juanmirocks.js
Pine Script for a TradingView indicator: Pivot Points
// @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