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
| uniform sampler2D tDiffuse; | |
| uniform sampler2D tLut; | |
| uniform int lutSize; | |
| uniform bool isEnabled; | |
| varying vec2 vUv; | |
| // Ref: http://www.khronos.org/webgl/wiki/WebGL_and_OpenGL_Differences#No_3D_Texture_support | |
| vec4 sampleAs3DTexture( sampler2D tex, vec3 texCoord, float size ) { | |
| float sliceSize = 1.0 / size; // space of 1 slice | |
| float slicePixelSize = sliceSize / size; // space of 1 pixel |
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
| <?xml version="1.0" encoding="utf-8"?> | |
| <!-- | |
| Copyright 2016 Google Inc. | |
| Licensed under the Apache License, Version 2.0 (the "License"); | |
| you may not use this file except in compliance with the License. | |
| You may obtain a copy of the License at | |
| http://www.apache.org/licenses/LICENSE-2.0 |
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
| /* | |
| * Copyright 2014 Chris Banes | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
You can use this class to realize a simple sectioned RecyclerView.Adapter without changing your code.
The RecyclerView should use a LinearLayoutManager.
You can use this code also with the TwoWayView with the ListLayoutManager (https://github.com/lucasr/twoway-view)
This is a porting of the class SimpleSectionedListAdapter provided by Google
Example:
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
| Toolbar toolbar = (Toolbar)findViewById(R.id.toolbar); | |
| //Title and subtitle | |
| toolbar.setTitle("MY toolbar"); | |
| toolbar.setSubtitle("Subtitle"); | |
| //Menu | |
| toolbar.inflateMenu(R.menu.toolbar_menu); | |
| toolbar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() { |
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
| <service android:name=".ListenerServiceFromWear"> | |
| <intent-filter> | |
| <action android:name="com.google.android.gms.wearable.BIND_LISTENER" /> | |
| </intent-filter> | |
| </service> |
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
| /* | |
| * Copyright 2014 Chris Banes | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
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
| /* | |
| * Copyright 2014 Google Inc. | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
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
| /** | |
| * Creates a 'ghost' bitmap version of the given source drawable (ideally a BitmapDrawable). | |
| * In the ghost bitmap, the RGB values take on the values from the 'color' argument, while | |
| * the alpha values are derived from the source's grayscaled RGB values. The effect is that | |
| * you can see through darker parts of the source bitmap, while lighter parts show up as | |
| * the given color. The 'invert' argument inverts the computation of alpha values, and looks | |
| * best when the given color is a dark. | |
| */ | |
| private Bitmap createGhostIcon(Drawable src, int color, boolean invert) { | |
| int width = src.getIntrinsicWidth(); |
NewerOlder
