Skip to content

Instantly share code, notes, and snippets.

View appcoreopc's full-sized avatar

jeremy woo appcoreopc

  • New Zealand
View GitHub Profile
mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
// Set up the ViewPager with the sections adapter.
mViewPager = (ViewPager) findViewById(R.id.container);
mViewPager.setAdapter(mSectionsPagerAdapter);
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabMode="fixed"
app:tabGravity="fill"/>
TabLayout tab = (TabLayout)findViewById(R.id.tabs);
tab.setupWithViewPager(mViewPager);
{
"userSecretsId": "aspnet5-MyWebApp-d857a31f-e7dc-4ad6-b479-0f403426db1a",
"version": "1.0.0-*",
"compilationOptions": {
"emitEntryPoint": true
},
"dependencies": {
"EntityFramework.Commands": "7.0.0-rc1-final",
"EntityFramework.MicrosoftSqlServer": "7.0.0-rc1-final",
public static string[] Projections = { "Id", "MemberId", "ClubId", "Type", "GoalValue" };
string selection = "ClubId = '?' AND MemberId = '?'" ;
string[] selectionArg = { "0", "CN640521" };
// executiing the query in contentprovider //
ContentResolver.Query(CONTENT_URI, GoalContentProvider.Projections, selection, selectionArg, null);
public class QueryBuilder
{
public static string buildQuery(string table, string[] projection, string selection, string[] selectionArgs, string sortOrder)
{
StringBuilder builder = new StringBuilder("SELECT ");
builder.Append(string.Join(",", projection));
builder.Append(" FROM " + table);
builder.Append(" WHERE ");
var regex = new Regex(Regex.Escape("?"));
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<declare-styleable name="GoalSetter">
<attr name="Title" format="string"/>
</declare-styleable>
</resources>
<xGauge.Controls.GoalSetter xmlns:customNS="http://schemas.android.com/apk/res/xGauge.xGauge"
android:id="@+id/clubVisit"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
customNS:Title="New Customer" />
using System;
using Android.Content;
using Android.OS;
using Android.Views;
using Android.Widget;
using Android.Util;
using Android.Content.Res;
namespace xGauge.Controls
{
// Fire up pretty late
public GoalSetter(Context ctx, IAttributeSet attr) : base(ctx, attr)
{
Init();
TypedArray ta = this.Context.ObtainStyledAttributes(attr, Resource.Styleable.GoalSetter, 0, 0);
if (ta != null)
_externalTitle = ta.GetString(Resource.Styleable.GoalSetter_Title);
if (_externalTitle != null)