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.company.product.net.interceptor; | |
import java.io.IOException; | |
import okhttp3.Interceptor; | |
import okhttp3.Request; | |
import okhttp3.Response; | |
/** | |
* Connect this interceptor to okhttp3 line to intercept all 401 answers from service and get callback |
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
// multicallback example | |
namespace com.example { | |
class Runner { | |
var devices = new List<Item>(); | |
void foo(){ | |
devices.Add(new Item()); | |
devices.Add(new Item(Handler)); | |
} |
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
// this is an internal class in example activity | |
// check file name and access modifiers before use | |
static class ExampleAdapter extends RecyclerView.Adapter<ExampleAdapter.ViewHolder> { | |
List<TodoListItem> items; | |
ClickListener clickListener; | |
Resources resources; | |
int DP16; | |
ExampleAdapter(Context context, List<TodoListItem> items) { |
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 static DateTime GetLinkerTime(this Assembly assembly, TimeZoneInfo target = null) | |
{ | |
var filePath = assembly.Location; | |
const int c_PeHeaderOffset = 60; | |
const int c_LinkerTimestampOffset = 8; | |
var buffer = new byte[2048]; | |
using (var stream = new FileStream(filePath, FileMode.Open, FileAccess.Read)) | |
stream.Read(buffer, 0, 2048); |
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.dementiev.realtest | |
import android.content.Context | |
import android.support.v7.widget.RecyclerView | |
import android.view.View | |
import android.view.ViewGroup | |
import android.widget.TextView | |
import android.util.TypedValue | |
import android.view.animation.AnimationUtils | |
import android.widget.LinearLayout |
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.dgse.grukoza_body_composition_tracker.helpers; | |
import android.view.View; | |
import android.view.ViewGroup.LayoutParams; | |
import android.view.animation.Animation; | |
import android.view.animation.Transformation; | |
/** | |
* Created by Андрей on 26.09.2014. | |
*/ |
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
{ | |
"FormattingOptions": { | |
"NewLinesForBracesInTypes": false, | |
"NewLinesForBracesInMethods": false, | |
"NewLinesForBracesInProperties": false, | |
"NewLinesForBracesInAccessors": false, | |
"NewLinesForBracesInAnonymousMethods": false, | |
"NewLinesForBracesInControlBlocks": false, | |
"NewLinesForBracesInAnonymousTypes": false, | |
"NewLinesForBracesInObjectCollectionArrayInitializers": false, |
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
import android.content.Intent; | |
import android.content.pm.PackageManager; | |
import android.net.Uri; | |
import android.os.Bundle; | |
import android.provider.Settings; | |
import android.support.annotation.Nullable; | |
import android.support.design.widget.Snackbar; | |
import android.support.v4.app.ActivityCompat; | |
import android.support.v4.content.ContextCompat; | |
import android.support.v7.app.AppCompatActivity; |
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
int maxWidth = viewHolder.viewGroup.getWidth(); | |
TextPaint textPaint = viewHolder.titleView.getPaint(); | |
String title = cursor.getString(ArticlesQuery.TITLE); | |
int chars = textPaint.breakText(title, true, maxWidth, null); | |
if (chars < title.length()) { | |
title = title.substring(0, chars); | |
} | |
viewHolder.titleView.setText(title); |
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
using UnityEngine; | |
using UnityEngine.UI; | |
[RequireComponent(typeof(Text))] | |
public class LocalizedText : MonoBehaviour { | |
// Use this for initialization | |
void Awake() { | |
var stringId = gameObject.name; | |
var language = Application.systemLanguage; |
OlderNewer