This file contains 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
[ | |
{ | |
"communityId": 1, | |
"communityName": "Ice Hockey Community club", | |
"communityType": "Leagues", | |
"description": "Club Membership can have more access on subscription", | |
"admin": [ | |
"Rohan", | |
"Raheem" | |
], |
This file contains 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
--Be aware: this function won't copy attributes of initial foreign key. | |
--It only takes foreign table name / column name, drops current key and replaces with new one. | |
CREATE OR REPLACE FUNCTION | |
replace_foreign_key(f_table VARCHAR, f_column VARCHAR, new_options VARCHAR) | |
RETURNS VARCHAR | |
AS $$ | |
DECLARE constraint_name varchar; | |
DECLARE reftable varchar; | |
DECLARE refcolumn varchar; |
This file contains 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
<SwipeRefreshLayoutWithEmpty ...> | |
<FrameLayout ...> | |
<TextView android:text="List is Empty" ...> | |
<RecyclerView ...> | |
</FrameLayout> | |
</SwipeRefreshLayoutWithEmpty> |
This file contains 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
private void initializeSwipeToRefresh() { | |
// Swipe down to force synchronize | |
//swipeRefreshLayoutUserRole = (SwipeRefreshLayout) findViewById(R.id.swipeRefreshLayout); | |
swipeRefreshLayoutUserRole.setDistanceToTriggerSync(390); | |
//swipeRefreshLayoutUserRole.setEnabled(true); //Controlled by fragments! | |
swipeRefreshLayoutUserRole.setColorSchemeResources( | |
android.R.color.holo_purple, android.R.color.holo_blue_light, | |
android.R.color.holo_green_light, android.R.color.holo_orange_light); | |
swipeRefreshLayoutUserRole.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { | |
@Override |
This file contains 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
public class SomeCode extends AppCompatActivity { | |
private final static long intervalTime = 3000; | |
static ArrayList<String> result = new ArrayList<String>(); | |
/** | |
* The {@link android.support.v4.view.PagerAdapter} that will provide | |
* fragments for each of the sections. We use a | |
* {@link FragmentPagerAdapter} derivative, which will keep every | |
* loaded fragment in memory. If this becomes too memory intensive, it | |
* may be best to switch to a |
This file contains 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
public String compressImage(String imageUri) { | |
String filePath = getRealPathFromURI(imageUri); | |
Bitmap scaledBitmap = null; | |
BitmapFactory.Options options = new BitmapFactory.Options(); | |
// by setting this field as true, the actual bitmap pixels are not loaded in the memory. Just the bounds are loaded. If | |
// you try the use the bitmap here, you will get null. | |
options.inJustDecodeBounds = true; |
This file contains 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
public Bitmap drawMultilineTextToBitmap(Context gContext, | |
int gResId, | |
String gText) { | |
// prepare canvas | |
Resources resources = gContext.getResources(); | |
float scale = resources.getDisplayMetrics().density; | |
Bitmap bitmap = BitmapFactory.decodeResource(resources, gResId); | |
android.graphics.Bitmap.Config bitmapConfig = bitmap.getConfig(); |
This file contains 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
package com.entriver.fieldpro.utils; | |
/** | |
* Created by fieldPro on 9/3/2018. | |
*/ | |
import android.content.Context; | |
import android.graphics.Canvas; | |
import android.graphics.Paint; | |
import android.graphics.RectF; | |
import android.os.Build; |
This file contains 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 LongToastMessageShower implements MessageShower{ | |
private Toast toast; | |
public LongToastMessageShower(Context appContext){ | |
this.toast = Toast.makeText(appContext,"",Toast.LENGTH_LONG); | |
} | |
@Override | |
public void showMessage(String message){ | |
toast.cancel(); |
This file contains 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
</b>mac-android && ios</b> | |
watchman watch-del-all && rm yarn.lock && rm -rf node_modules && rm -rf $TMPDIR/metro-* && rm -rf $TMPDIR/haste-map-* && yarn |
OlderNewer