-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
118 additions
and
86 deletions.
There are no files selected for viewing
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
|
||
<string name="app_name">CViewPager</string> | ||
<string name="app_name">JellyViewPager</string> | ||
<string name="hello_world">Hello world!</string> | ||
<string name="action_settings">Settings</string> | ||
<string name="text1">便便的离去,是马桶的吸引,还是屁股的不挽留?</string> | ||
<string name="text2">美丽风景……</string> | ||
|
||
</resources> |
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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package com.chiemy.jellyviewpager; | ||
|
||
import com.chiemy.jellyviewpager.util.Constant; | ||
|
||
import android.os.Bundle; | ||
import android.support.v4.app.Fragment; | ||
import android.view.LayoutInflater; | ||
import android.view.View; | ||
import android.view.View.OnClickListener; | ||
import android.view.ViewGroup; | ||
import android.widget.ImageView; | ||
import android.widget.TextView; | ||
|
||
public class TestFragment extends Fragment { | ||
boolean visible = true; | ||
@Override | ||
public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState) { | ||
View rootView = inflater.inflate(R.layout.frag_layout, container, false); | ||
initUI(rootView); | ||
return rootView; | ||
} | ||
|
||
private void initUI(View root){ | ||
final View tv1 = root.findViewById(R.id.textView1); | ||
final View tv2 = root.findViewById(R.id.textView2); | ||
ImageView iv = (ImageView) root.findViewById(R.id.imageView1); | ||
Bundle bundle = getArguments(); | ||
int res = bundle.getInt(Constant.KEY, R.drawable.a); | ||
iv.setImageResource(res); | ||
iv.setOnClickListener(new OnClickListener() { | ||
@Override | ||
public void onClick(View v) { | ||
if(!visible){ | ||
visible = true; | ||
tv1.setVisibility(View.VISIBLE); | ||
tv2.setVisibility(View.VISIBLE); | ||
}else{ | ||
visible = false; | ||
tv1.setVisibility(View.INVISIBLE); | ||
tv2.setVisibility(View.INVISIBLE); | ||
} | ||
} | ||
}); | ||
} | ||
|
||
} |
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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.chiemy.jellyviewpager.util; | ||
|
||
import com.chiemy.jellyviewpager.R; | ||
import com.chiemy.jellyviewpager.R.drawable; | ||
|
||
public class Constant { | ||
public static final String KEY = "image"; | ||
|
||
public static int [] images = {R.drawable.a,R.drawable.b, | ||
R.drawable.c,R.drawable.d,R.drawable.e}; | ||
|
||
} |
2 changes: 1 addition & 1 deletion
2
src/com/example/cviewpager/SpringSystem.java → ...emy/jellyviewpager/util/SpringSystem.java
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 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 file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.