This file contains hidden or 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
Intent galleryIntent = new Intent(Intent.ACTION_GET_CONTENT,null); | |
galleryIntent.setType("image/*"); | |
galleryIntent.addCategory(Intent.CATEGORY_OPENABLE); | |
Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); | |
Intent chooser = new Intent(Intent.ACTION_CHOOSER); | |
chooser.putExtra(Intent.EXTRA_INTENT, galleryIntent); | |
chooser.putExtra(Intent.EXTRA_TITLE, "title"); |
This file contains hidden or 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 FontTabLayout extends TabLayout { | |
private Typeface typeface; | |
public FontTabLayout(Context context) { | |
super(context); | |
init(context, null); | |
} | |
public FontTabLayout(Context context, AttributeSet attrs) { |
This file contains hidden or 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
LayoutInflater factory = LayoutInflater.from(this); // this это context | |
// final - для того чтобы использовать его в OnClickListener() | |
final View alertView = factory.inflate(R.layout.layout_add_note, null); | |
AlertDialog.Builder builder = new AlertDialog.Builder(this); | |
builder.setView(alertView); | |
builder.setTitle(R.string.alert_title_add); | |
builder.setNegativeButton(R.string.alert_cancel, null); | |
builder.setPositiveButton(R.string.menu_add, new DialogInterface.OnClickListener() { | |
@Override |
This file contains hidden or 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
// GameManager.java | |
public class GameManager { | |
private GameManager() {} | |
public static create(){ | |
GameManager gm = new GameManager(); | |
gm. // инициализируем созданием нового | |
return gm; | |
} | |
public static createFromStream(InputStream stream){ | |
GameManager gm = new GameManager(); |
This file contains hidden or 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 EndlessList { | |
companion object { | |
fun <T> get(recyclerView: RecyclerView, next: (Int) -> Observable<Response<T>>): Observable<Response<T>> { | |
var loading = false | |
var hasNextPage = true | |
return Observable.create<Int> { | |
val lm = recyclerView.layoutManager | |
val getLastVisible = if (lm is LinearLayoutManager) { | |
fun() = lm.findLastVisibleItemPosition() | |
} else if (lm is GridLayoutManager) { |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head></head> | |
<body> | |
<div id="task1"> | |
<input id="t0" type="number" value="18.5"/> | |
</div> | |
<div id="task2"> | |
<input id="t0" type="number" value="18.5"/> | |
</div> |
This file contains hidden or 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
<?php | |
namespace Models\v2; | |
abstract class EventSubject extends \Models\EventSubject { | |
public static function schedule($id) { | |
$res = parent::schedule($id); | |
for ($w=0; $w<count($res); ++$w) { | |
for ($d=0; $d<count($res[$w]['days']); ++$d) { | |
for ($e=0; $e<count($res[$w]['days'][$d]['events']); ++$e) { |
This file contains hidden or 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
<?php | |
namespace Models; | |
class Group extends EventSubject | |
{ | |
public static function subjectName() { | |
return 'group'; | |
} | |
public static function reverseName() { |
This file contains hidden or 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
<?php | |
namespace Models; | |
abstract class EventSubject { | |
public static abstract function subjectName(); | |
public static function reverseName(){} | |
/*public static function subjectId() { |