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
package com.ilegendsoft.toprankapps.musictube.adapters; | |
import android.content.Context; | |
import android.support.v4.app.Fragment; | |
import android.support.v4.app.FragmentManager; | |
import android.support.v4.app.FragmentPagerAdapter; | |
import com.toprankapps.musictube4.R; | |
import com.ilegendsoft.toprankapps.musictube.fragments.HotArtistFragment; | |
import com.ilegendsoft.toprankapps.musictube.fragments.PopularFragment; |
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
/* Clear all Fragments inside current adapter */ | |
public class MyPagerAdapter extends FragmentPagerAdapter | |
{ | |
private ArrayList<Fragment> fragments=new ArrayList<Fragment>(); | |
//...some stuff | |
public void clearAll() //Clear all page | |
{ | |
for(int i=0; i<fragments.size(); i++) | |
fragMan.beginTransaction().remove(fragments.get(i)).commit(); |
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
When a user interacts with a UI element the various listeners are called in a top down order. (For example: OnTouch -> OnFocusChange -> OnClick.) If a listener has been defined (with setOn...Listener) and it consumes this event: the lower priority listeners will not be called. By its nature the first time you touch an EditText it receives focus with OnFocusChangeListener so that the user can type. The action is consumed here therefor OnClick is not called. Each successive touch doesn't change the focus so the event trickles down to the OnClickListener. | |
Basically, you have three choices: | |
Set the focusable attribute to false in your XML: | |
android:focusable="false" | |
Now the OnClickListener will fire every time it is clicked. But this makes the EditText useless since the user can no longer enter any text... | |
Implement an OnFocusChangeListener along with the OnClickListener: |
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
mFilterWindow = new PopupWindow(popupLayout, | |
WindowManager.LayoutParams.WRAP_CONTENT, | |
WindowManager.LayoutParams.WRAP_CONTENT); | |
mFilterWindow.setOutsideTouchable(true); | |
mFilterWindow.setBackgroundDrawable(new ColorDrawable()); | |
mFilterWindow.setFocusable(true); |
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
<SeekBar | |
android:id="@+id/mediacontroller_progress" | |
style="?android:attr/progressBarStyleHorizontal" | |
android:layout_width="match_parent" | |
android:layout_height="24dp" | |
android:maxHeight="2dp" | |
android:progressDrawable="@drawable/seekbar" | |
android:thumb="@drawable/seekbar_thumb" /> | |
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
package com.ilegendsoft.toprankapps.tubeplayer.utils; | |
import android.os.Environment; | |
import android.os.StatFs; | |
public class FSUtil { | |
// One binary gigabyte equals 1,073,741,824 bytes. | |
private static final long PER_G_NUM = 1073741824; | |
public static String getAvailableSpace() { |
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
List<Fruit> fruits= new ArrayList<Fruit>(); | |
Fruit fruit; | |
for(int i=0;i<100;i++) | |
{ | |
fruit = new fruit(); | |
fruit.setname(...); | |
fruits.add(fruit); | |
} |
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"?> | |
<resources> | |
<style name="Theme.AppCompat.Light.NoActionBar" parent="@style/Theme.AppCompat.Light"> | |
<item name="android:windowNoTitle">true</item> | |
</style> | |
</resources> |
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
<activity | |
android:name="com.ilegendsoft.toprankapps.tubeplayer.activities.PlayVideoActivity" | |
android:configChanges="orientation|screenSize" | |
android:launchMode="singleTop" | |
android:logo="@drawable/play_video_back" > | |
</activity> | |
<?xml version="1.0" encoding="utf-8"?> | |
<layer-list |