Skip to content

Instantly share code, notes, and snippets.

@Mushtaq123
Mushtaq123 / SocialConnection.java
Created January 18, 2019 04:08 — forked from jaisonfdo/SocialConnection.java
Connect social media account in a single line of code in Android.For more information, check out my detailed guide here : http://droidmentor.com/connect-social-media-account/
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.text.TextUtils;
import android.widget.Toast;
/**
<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:GridSample"
x:Class="GridSample.GridSamplePage">
<ContentPage.Resources>
<ResourceDictionary>
<Style x:Key="headerTablet" TargetType="Label">
<Setter Property="TextColor" Value="White" />
<Setter Property="FontAttributes" Value="Bold" />
public String ConvertImageURLToBase64(String url)
{
StringBuilder _sb = new StringBuilder();
Byte[] _byte = this.GetImage(url);
_sb.Append(Convert.ToBase64String(_byte, 0, _byte.Length));
return _sb.ToString();
}
@Mushtaq123
Mushtaq123 / GsonRequest.java
Created January 13, 2018 06:51
A Volley request that uses the Google gson library to parse JSON into Java objects
/*
* Copyright (c) 2013 vomitcuddle <shinku@dollbooru.org>
* License: Do What the Fr*ck You Want to Public License v2
*/
package com.github.vomitcuddle;
import com.android.volley.NetworkResponse;
import com.android.volley.ParseError;
import com.android.volley.Request;
@Mushtaq123
Mushtaq123 / AnimationNavigationRenderer.cs
Created October 23, 2017 04:03 — forked from alexlau811/AnimationNavigationRenderer.cs
A custom renderer to set custom animation for NavigationPage.PushAsync and NavigationPage.PopAsync on iOS with Xamarin Forms.
[assembly: ExportRenderer(typeof(NavigationPage), typeof(AnimationNavigationRenderer))]
class AnimationNavigationRenderer : NavigationRenderer
{
public override void PushViewController(UIViewController viewController, bool animated)
{
if (animated)
{
// Alternative way with different set of trannsition
/*
using System;
using Xamarin.Forms;
using System.Collections.ObjectModel;
using System.Threading.Tasks;
namespace LoadMoreBottom
{
public class App : Application
{
@Mushtaq123
Mushtaq123 / ITextMeter
Created August 22, 2017 10:17 — forked from alexrainman/ITextMeter
Calculate Xamarin.Forms label height by amount of text
namespace YourNamespace
{
public interface ITextMeter
{
double MeasureTextSize(string text, double width, double fontSize, string fontName = null);
}
}
@Mushtaq123
Mushtaq123 / auto_update.md
Created July 21, 2017 03:48 — forked from lifuzu/auto_update.md
Android auto update apk implementation
public class UpdateApp extends AsyncTask<String,Void,Void>{
private Context context;
public void setContext(Context contextf){
    context = contextf;
}

@Override
protected Void doInBackground(String... arg0) {
      try {