Friday, 1 January 2021

How to make Intellij Idea's Intellisense work on C++ and Kotlin on a Flutter project?

Due to opening a Flutter project into Intellij Idea, that is, opening the folder that contains both an Android project and an iOS project, Intellij Idea does not recognize the Android gradle project and thus both C++ and Kotlin intellisense won't work. Additionally, logcat wont work: How to get logcat working on Intellij Idea on Flutter project?

A solution would be to open the android folder into another window, but this is not very good. Having everything on one window is much better, specially if you develop inside docker using the docker plugin.

Opening thins in Android Studio also has this effect and there's not even a Docker plugin there.

So, how can I use C++ and Kotlin intellisense on Intellij Idea in a Flutter project?



from How to make Intellij Idea's Intellisense work on C++ and Kotlin on a Flutter project?

Cordova camera plugin works on emulator and not on Android device

I'm building an app that allows the user to take photos. I'm using Cordova - JS/CSS/HTML - to write the script. The Cordova camera plugin works perfectly on my Android emulator in Android Studio, but I can't get it to work on my device. Here's what I'm working with:

IRL Phone: Samsung Galaxy S9+

Cordova version: 10.0.0

Cordova camera plugin version: 5.0.1

I'm not sure if it has something to do with an inconsistency in the build (I heard Cordova versions can have an effect on plugins in certain environments) or if my code is just not friendly for a real Android device.

Here's the plugin code:

let app = {
    init: function(){
        document.getElementById('btn').addEventListener('click', app.takephoto);
    },
    takephoto: function(){
        let opts = {
            quality: 80,
            destinationType: Camera.DestinationType.FILE_URI,
            sourceType: Camera.PictureSourceType.CAMERA,
            mediaType: Camera.MediaType.PICTURE,
            encodingType: Camera.EncodingType.JPEG,
            cameraDirection: Camera.Direction.BACK,
            targetWidth: 300,
            targetHeight: 400
        };

        navigator.camera.getPicture(app.ftw, app.wtf, opts);
    },
    ftw: function(imgURI){
        document.getElementById('msg').textContent = imgURI;
        document.getElementById('photo').src = imgURI;

    },
    wtf: function(msg){
        document.getElementById('msg').textContent = msg;
    }
};

document.addEventListener('deviceready', app.init);

Here's the HTML that runs the script on the app's page from the file camera.js in a separate folder:

        <div class="page">
            <p class="code"><img src="img/logo.png" alt="image" id="photo" /></p>
            <p class="node"><button id="btn">Take Picture</button></p>
            <p id="msg"></p>
        </div>
        <script type="text/javascript" src="cordova.js"></script>
        <script src="js/camera.js"></script>

And here's the information in my head tag:

<meta http-equiv="Content-Security-Policy" 
content="default-src 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval'; 
style-src 'self' 'unsafe-inline'; 
media-src *; 
script-src 'self' 'unsafe-inline';
img-src 'self' data: content:;">
<meta name="format-detection" content="telephone=no">
<meta name="msapplication-tap-highlight" content="no">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">

<link rel="stylesheet" type="text/css" href="css/index.css" /> 
<title>4-Point Inspection</title>

Maybe this has something to do with the XML or build files? This is my first Cordova app so I'm a little new to this. Any ideas why it works on emulator and not on my Galaxy S9+?



from Cordova camera plugin works on emulator and not on Android device

Setting responsive font size doesn't work in revolution slider jQuery plugin

I'm trying to set responsive font-size for text in revolution slider jQuery version but I see revolution slider gives it another font-size in inline style by itself instead of my specified font sizes in the data-fontsize attribute for the layer. I Think that it gives another sizes between my specified font size between two viewport sizes.

This is what i've tried:

<section class="slider-container" id="">
  <div class="container-fluid">
    <div class="row">
      <div class="col-12">
        <div id="slider" class="rev_slider fullwidthbanner" style="display:none;" data-version="5.4.8.2">
          <ul>
            <li data-transition="cube-horizontal"  data-hideslideonmbile="false" style="">
              <img src="pictures/psy13.jpg" alt="psycholoist picture">
              <div class="tp-caption rev_group rs-parallaxlevel-1"
              data-width="100%"
              data-height="full"
              data-x="['left','left','center','center']"
              data-hoffset="['32','40','0','0']"
              data-y="['center','center','center','center']"
              data-type="group"
              data-responsive_offset="on"
              data-frames='[{
                "delay":100,
                "speed":300,
                "frame":"0",
                "to":"o:1;",
                "ease":"Power3.easeInOut"
              },{
                "delay":"wait",
                "speed":300,
                "frame":"999",
                "to":"opacity:0;",
                "ease":"Power3.easeInOut"
              }]'
              style="position:relative; z-index:6; "
              >
              <div class="tp-caption tp-resizeme"
                data-type="text"
                data-x="['left','left','center','center']" data-hoffset="['0','0','0','0']"
                data-y="['center','center','center','center']" data-voffset="['0','0','0','-60']"
                data-fontsize='[20,18,17,16]'
                data-lineheight="[66,52,52,40]"
                data-frames='[{
                  "delay":"+90",
                  "speed":1500,
                  "frame":"0",
                  "from":"x:[-100%];z:0;rX:0deg;rY:0;rZ:0;sX:1;sY:1;skX:0;skY:0;",
                  "to":"o:1;",
                  "mask":"x:0px;y:0px;s:inherit;e:inherit;",
                  "ease":"Power3.easeInOut"
                },{
                  "delay":"wait",
                  "speed":300,
                  "frame":"999",
                  "to":"opacity:0;",
                  "ease":"Power3.easeInOut"
                }]'
                data-responsive_offset="on"
                style=" z-index: 9;position: relative; white-space: nowrap; color:white; font-weight:100;"
              >
                 We Solve the problems that is beyond your control
               </div>
              </div>
              <div class="tp-caption tp-resizeme tp-shape tp-shapewrapper"
                data-x="[center,center,center,center]" data-hoffset="[0,0,0,0]"
                data-y="[center,center,center,center]" data-voffset="[0,0,0,0]"
                data-type="shape"
                data-height="full"
                data-width:"full"
                data-whitespace="nowrap"
                data-frames='[{
                  "delay":100,
                  "speed":1500,
                  "frame":0,
                  "from":"opacity:0;",
                  "to":"o:1;",
                  "ease":"Power3.easeInOut"
              },
              {
                  "delay":"wait",
                  "speed":300,
                  "frame":"999",
                  "to":"opacity:0",
                  "ease":"Power3.easeInOut"
              }]'
                style="background:rgba(0,0,0,0.35); width:200vw; position:relative; z-index:1;"
              >
              </div>
            </li>
          </ul>
        </div>
      </div>
    </div>
  </div>
</section>
$('#slider').show().revolution({
  delay:9000,
  autoHeight:"off",
  sliderLayout: 'fullwidth',
  sliderType:'standard',
  speed:'400',
  responsiveLevels:[1200,992,768,576],
  visibilityLevels:[1200,992,768,576],
  gridwidth:[1240,1024,778,480],
  gridheight:[1000,600,650,600],
  parallax: {
    type:"mouse",
    origo:"slidercenter",
    speed:400,
    speedbg:0,
    speedls:0,
    levels:[1,10,15,20,25,30,35,40,45,46,47,48,49,50,51,55],
    disable_onmobile:"on"
  }
});

Please, How to disable this?



from Setting responsive font size doesn't work in revolution slider jQuery plugin