Skip to content

Commit 21059ac

Browse files
committed
Manual Height and Width Bug Fix
1 parent b4c4bdd commit 21059ac

File tree

6 files changed

+32
-2
lines changed

6 files changed

+32
-2
lines changed

.idea/gradle.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/libraries/AndroidImagePopup_1_0_7.xml

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations.xml

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ dependencies {
2727
compile 'com.android.support:appcompat-v7:25.0.0'
2828
compile project(":imageviewpopup")
2929
//compile 'com.github.chathuralakmal:AndroidImagePopup:-SNAPSHOT'
30-
//compile 'com.github.chathuralakmal:AndroidImagePopup:1.0.6'
30+
//compile 'com.github.chathuralakmal:AndroidImagePopup:1.0.7'
3131
testCompile 'junit:junit:4.12'
3232
}

app/src/main/java/com/fexcon/imgpopup/MainActivity.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ protected void onCreate(Bundle savedInstanceState) {
2929
/** Set Image Height, Width & Background Color as you want **/
3030
final ImagePopup imagePopup = new ImagePopup(this);
3131
//imagePopup.setBackgroundColor(Color.BLACK);
32+
imagePopup.setWindowHeight(200);
33+
imagePopup.setWindowWidth(200);
3234
imagePopup.setHideCloseIcon(true);
3335
imagePopup.setImageOnClickClose(true);
3436

imageviewpopup/src/main/java/com/ceylonlabs/imageviewpopup/ImagePopup.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,15 @@ public void initiatePopup(Drawable drawable){
118118
Log.e("Phone Height","-->"+metrics.heightPixels);
119119
Log.e("Phone Width","-->"+metrics.widthPixels);
120120

121+
121122
int width = metrics.widthPixels;
122123
int height = metrics.heightPixels;
123124

125+
if(windowHeight != 0 || windowWidth !=0){
126+
width = windowWidth;
127+
height = windowHeight;
128+
}
129+
124130
// ((Activity) getContext()).getWindow().setLayout((int)(width*.8),(int)(height*.6));
125131
//
126132

0 commit comments

Comments
 (0)