Skip to content

Instantly share code, notes, and snippets.

View WillyShakes's full-sized avatar
💭
I may be slow to respond.

Wilfried Mbouenda Mbogne WillyShakes

💭
I may be slow to respond.
View GitHub Profile
<activity
android:name="your.package.MyActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.Leanback.CustomTitle"/>
<style name="AppTheme.Leanback.CustomTitle" parent="Theme.Leanback.Browse">
<item name="browseTitleViewLayout">@layout/titleview</item>
<item name="browseRowsMarginTop">60dp</item>
</style>
<?xml version="1.0" encoding="utf-8"?>
<your.package.CustomTitleView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/browse_title_group"
android:padding="16dp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
@WillyShakes
WillyShakes / CustomTitleView.java
Last active March 14, 2018 21:11
class for our Custom title
public class CustomTitleView extends RelativeLayout implements TitleViewAdapter.Provider {
private final TextView mTitleView;
private final TitleViewAdapter mTitleViewAdapter = new TitleViewAdapter() {
@Override
public View getSearchAffordanceView() {
return null;
}
@Override
@WillyShakes
WillyShakes / custom_titleview.xml
Created March 8, 2018 11:59
layout of our custom title view
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/title_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@WillyShakes
WillyShakes / instagram.dart
Created February 21, 2018 06:18
instagran authentication
Future<Token> getToken(String appId, String appSecret) async {
Stream<String> onCode = await _server();
String url =
"https://api.instagram.com/oauth/authorize?client_id=$appId&redirect_uri=http://localhost:8585&response_type=code";
final flutterWebviewPlugin = new FlutterWebviewPlugin();
flutterWebviewPlugin.launch(url);
final String code = await onCode.first;
final http.Response response = await http.post(
"https://api.instagram.com/oauth/access_token",
body: {"client_id": appId, "redirect_uri": "http://localhost:8585", "client_secret": appSecret,
@WillyShakes
WillyShakes / login_presenter.dart
Last active February 21, 2018 06:12
flutter auth login presenter
class LoginPresenter {
LoginViewContract _view;
LoginPresenter(this._view);
void perform_login() {
assert(_view != null);
insta.getToken(<APP_ID>,
<APP_SECRET>).then((token)
{
if (token != null) {
@WillyShakes
WillyShakes / login_view.dart
Created February 21, 2018 06:07
UI of the flutter auth application
widget = new Padding(
padding: new EdgeInsets.all(32.0),
child: new Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
new Text(
'Welcome to FlutterAuth,',
style: DefaultTextStyle.of(context).style.apply(fontSizeFactor: 1.5),),
new Text('Login to continue'),
@WillyShakes
WillyShakes / CustumArrayObjectAdapter.java
Created July 24, 2016 07:42
Custum ArrayObjectAdapter
/*
* Copyright (C) 2014 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express